// 安全检查管理
var $SafeCheckManagement = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            ////删除
            case '/api/SafeCheckManagement/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $SafeCheckManagement.Arrays.length; i++) {
                        temp.push($SafeCheckManagement.Arrays[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $SafeCheckManagement.Arrays.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/SafeCheckManagement/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($SafeCheckManagement.Arrays.length == 0) {
                            $SafeCheckManagement.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //查询条件 写自己的查询条件 
                        var describe = p.model.describe;
                        var hiddenTroubleClass = p.model.hiddenTroubleClass;
                        var headOperations = p.model.headOperations;
                        var YNFinish = p.model.YNFinish;
                        var reportDateStart = p.model.reportDateStart;
                        var reportDateEnd = p.model.reportDateEnd;
                        //分页条件
                        var offset = p.offset;
                        var limit = p.limit;
                        //查询条件 按自己实际的去过滤
                        var limitArrays2 = [];
                        for (var i = 0; i < $SafeCheckManagement.Arrays.length; i++) {
                            var SafeCheckManagement = $SafeCheckManagement.Arrays[i];
                            if (describe && SafeCheckManagement.describe.indexOf(describe) == -1)
                                continue;
                            if (hiddenTroubleClass && SafeCheckManagement.hiddenTroubleClass.indexOf(hiddenTroubleClass) == -1)
                                continue;
                            if (headOperations && SafeCheckManagement.headOperations.indexOf(headOperations) == -1)
                                continue;
                            if (YNFinish && SafeCheckManagement.YNFinish.indexOf(YNFinish) == -1)
                                continue;

                            if (reportDateStart && reportDateStart >= SafeCheckManagement.reportDate)
                                continue;
                            if (reportDateEnd && reportDateEnd <= SafeCheckManagement.reportDate)
                                continue;
                            limitArrays2.push(SafeCheckManagement);
                        }
                        var limitArrays = [];
                        for (var i = 0; i < limitArrays2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitArrays.push(limitArrays2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitArrays,
                                rowCount: limitArrays2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/SafeCheckManagement/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myArrays = parent.$SafeCheckManagement.Arrays;
                    myarray = {};
                    for (var i = 0; i < myArrays.length; i++) {
                        if (myArrays[i].id == vueApp.id) {
                            myarray = myArrays[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myarray
                    };
                });
                break;
                //提交
            case '/api/SafeCheckManagement/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    var thisArrays = parent.$SafeCheckManagement.Arrays;
                    var cz = true;
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].describe = thisentity.describe;
                            thisArrays[i].hiddenTroubleClass = thisentity.hiddenTroubleClass;
                            thisArrays[i].reportPerson = thisentity.reportPerson;
                            thisArrays[i].reportDate = thisentity.reportDate;
                            thisArrays[i].headOperations = thisentity.headOperations;
                            thisArrays[i].planDate = thisentity.planDate;
                            thisArrays[i].YNFinish = thisentity.YNFinish;
                            thisArrays[i].YNPublic = thisentity.YNPublic;
                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$SafeCheckManagement.Arrays.push({
                            id: thisentity.id,
                            describe: thisentity.describe,
                            hiddenTroubleClass: thisentity.hiddenTroubleClass,
                            reportPerson: thisentity.reportPerson,
                            reportDate: thisentity.reportDate,
                            headOperations: thisentity.headOperations,
                            planDate: thisentity.planDate,
                            YNFinish: thisentity.YNFinish,
                            YNPublic: thisentity.YNPublic,
                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            //注意  随机数据初始都是随机姓名，需要自己手动调整
            $SafeCheckManagement.Arrays.push(Mock.mock({
                id: Mock.Random.id(), //必须有
                describe: randomValue('19'),
                hiddenTroubleClass: randomValue('n59'),
                reportPerson: Mock.Random.cname(),
                reportDate: Mock.Random.date(),
                correctiveAction: randomValue('17'),
                headOperations: Mock.Random.cname(),
                planDate: Mock.Random.date(),
                YNFinish: randomValue('50'),
                YNPublic: randomValue('50'),
            }));

        }
    }
}

// 安全活动里程碑
var $SafetyMilestone = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            ////删除
            case '/api/SafetyMilestone/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $SafetyMilestone.Arrays.length; i++) {
                        temp.push($SafetyMilestone.Arrays[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $SafetyMilestone.Arrays.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/SafetyMilestone/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($SafetyMilestone.Arrays.length == 0) {
                            $SafetyMilestone.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //查询条件 写自己的查询条件 
                        var activityName = p.model.activityName;
                        var activityTimeStart = p.model.activityTimeStart;
                        var activityTimeEnd = p.model.activityTimeEnd;
                        //分页条件
                        var offset = p.offset;
                        var limit = p.limit;
                        //查询条件 按自己实际的去过滤
                        var limitArrays2 = [];
                        for (var i = 0; i < $SafetyMilestone.Arrays.length; i++) {
                            var SafetyMilestone = $SafetyMilestone.Arrays[i];
                            if (activityName && SafetyMilestone.activityName.indexOf(activityName) == -1)
                                continue;

                            if (activityTimeStart && activityTimeStart >= SafetyMilestone.activityTime)
                                continue;
                            if (activityTimeEnd && activityTimeEnd <= SafetyMilestone.activityTime)
                                continue;
                            limitArrays2.push(SafetyMilestone);
                        }
                        var limitArrays = [];
                        for (var i = 0; i < limitArrays2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitArrays.push(limitArrays2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitArrays,
                                rowCount: limitArrays2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/SafetyMilestone/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myArrays = parent.$SafetyMilestone.Arrays;
                    myarray = {};
                    for (var i = 0; i < myArrays.length; i++) {
                        if (myArrays[i].id == vueApp.id) {
                            myarray = myArrays[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myarray
                    };
                });
                break;
                //提交
            case '/api/SafetyMilestone/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    var thisArrays = parent.$SafetyMilestone.Arrays;
                    var cz = true;
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].activityName = thisentity.activityName;
                            thisArrays[i].activityTime = thisentity.activityTime;
                            thisArrays[i].activityTimeItem = thisentity.activityTimeItem;
                            thisArrays[i].uploadPerson = thisentity.uploadPerson;
                            thisArrays[i].uploadTime = thisentity.uploadTime;
                            thisArrays[i].attachmentName = thisentity.attachmentName;
                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$SafetyMilestone.Arrays.push({
                            id: thisentity.id,
                            activityName: thisentity.activityName,
                            activityTime: thisentity.activityTime,
                            activityTimeItem: thisentity.activityTimeItem,
                            uploadPerson: thisentity.uploadPerson,
                            uploadTime: thisentity.uploadTime,
                            attachmentName: thisentity.attachmentName,
                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            //注意  随机数据初始都是随机姓名，需要自己手动调整
            $SafetyMilestone.Arrays.push(Mock.mock({
                id: Mock.Random.id(), //必须有
                activityName: randomValue('n60'),
                // activityTime: Mock.Random.date('yyyy')+'，'+randomValue('n96'),
                activityTime: Mock.Random.date('yyyy'),
                activityTimeItem: randomValue('n96'),
                prizeResearchProcess: randomValue('n61'),
                main: randomValue('n62'),
                attachmentName: randomValue('n63'),
                uploadTime: Mock.Random.date(),
                uploadPerson: Mock.Random.cname(),
                lastUpdate: Mock.Random.date(),
            }));

        }
    }
}

//组织架构维护
var OrganizationalStructureMaintenance = [{
    id: 1,
    label: '安全分委会',
    children: [{
        id: 2,
        label: '委员会主任',
        children: [{
            id: 3,
            label: '秘书',
            children: [{
                id: 4,
                label: '成员',
            }]
        }]
    }]
}];
var treeOrganizationalStructureMaintenance = [{
        "id": 1,
        "pid": 0,
        "name": "委员会董事",
    },
    {
        "id": 2,
        "pid": 1,
        "name": "秘书",
    },
    {
        "id": 3,
        "pid": 2,
        "name": "成员",
    },
    {
        "id": 4,
        "pid": 2,
        "name": "成员",
    }
];
//安全分委会组织架构    
var $OrganizationalStructureSafety = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            ////删除
            case '/api/OrganizationalStructureSafety/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $OrganizationalStructureSafety.EquipmenFacilities.length; i++) {
                        temp.push($OrganizationalStructureSafety.EquipmenFacilities[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $OrganizationalStructureSafety.EquipmenFacilities.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/OrganizationalStructureSafety/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($OrganizationalStructureSafety.EquipmenFacilities.length == 0) {
                            $OrganizationalStructureSafety.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //条件
                        var Name = p.model.Name;
                        var Department = p.model.Department;
                        var PhoneNumber = p.model.PhoneNumber;
                        var ExtensionNumber = p.model.ExtensionNumber;

                        //分页
                        var TreeNode = p.model.TreeNode;
                        var offset = p.offset;
                        var limit = p.limit;

                        var limitUsers2 = [];
                        for (var i = 0; i < $OrganizationalStructureSafety.EquipmenFacilities.length; i++) {
                            var user = $OrganizationalStructureSafety.EquipmenFacilities[i];
                            if (Name && user.Name.indexOf(Name) == -1)
                                continue;
                            if (Department && user.Department.indexOf(Department) == -1)
                                continue;
                            if (PhoneNumber && user.PhoneNumber.indexOf(PhoneNumber) == -1)
                                continue;
                            if (ExtensionNumber && user.ExtensionNumber.indexOf(ExtensionNumber) == -1)
                                continue;
                            if (TreeNode && user.TreeNode.indexOf(TreeNode) == -1)
                                continue;
                            user.RiskLevel = getDicValue("03", user.RiskLevel) == '' ? user.RiskLevel : getDicValue("03", user.RiskLevel);
                            limitUsers2.push(user);
                        }
                        var limitUsers = [];
                        for (var i = 0; i < limitUsers2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitUsers.push(limitUsers2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitUsers,
                                rowCount: limitUsers2.length
                            }
                        };
                    });
                break;
                ////获取Input数据
            case '/api/OrganizationalStructureSafety/get':
                Mock.mock(host + url + '?' + param, type, function (options) {

                    var myUsers = parent.$OrganizationalStructureSafety.EquipmenFacilities;
                    myuser = {};
                    for (var i = 0; i < myUsers.length; i++) {
                        if (myUsers[i].id == vueApp.id) {
                            myuser = myUsers[i];
                            break;
                        }
                    }
                    myuser.RiskLevel = getDicKey("03", myuser.RiskLevel);
                    return {
                        result: "Success",
                        message: null,
                        data: myuser
                    };
                });
                break;
                ////提交
            case '/api/OrganizationalStructureSafety/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisuser = JSON.parse(options.body);
                    var thisUsers = parent.$OrganizationalStructureSafety.EquipmenFacilities;
                    var cz = true;

                    for (var i = 0; i < thisUsers.length; i++) {
                        if (thisUsers[i].id == thisuser.id) {
                            thisUsers[i].Name = thisuser.Name;
                            thisUsers[i].Department = thisuser.Department;
                            thisUsers[i].PhoneNumber = thisuser.PhoneNumber;
                            thisUsers[i].ExtensionNumber = thisuser.ExtensionNumber;
                            // thisUsers[i].TreeNode = thisentity.TreeNode;
                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        parent.$OrganizationalStructureSafety.EquipmenFacilities.push({
                            id: thisuser.id,
                            Name: thisuser.Name,
                            Department: thisuser.Department,
                            PhoneNumber: thisuser.PhoneNumber,
                            ExtensionNumber: thisuser.ExtensionNumber,
                            RiskLevel: thisuser.RiskLevel,
                            TreeNode: thisuser.TreeNode,
                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    EquipmenFacilities: [],
    InitArray: function () {
        for (var i = 0; i < 80; i++) {
            $OrganizationalStructureSafety.EquipmenFacilities.push(Mock.mock({
                id: Mock.Random.id(),
                Name: Mock.Random.cname(), //名称
                Department: randomValue("14"), //部门
                PhoneNumber: randomValue("n64"), //手机号码
                ExtensionNumber: Mock.Random.string('number', 4), //分机号码
                RiskLevel: randomValue('03'),
                TreeNode: randomTreeNode(treeOrganizationalStructureMaintenance)
            }));
        }
    }
}


// 办公安全分委会积分考核-数据
var ScoreAssessmentOfficeSecurityData = [{
        "id": 1,
        "pid": 0,
        "code": 10000,
        "name": "郝磊",
        "allScore": '84',
        'childData': [{
            time: '2019.1',
            type: '参会',
            integral: '11',
        }, {
            time: '2019.2',
            type: '改进型',
            integral: '15',
        }]
    },
    {
        "id": 2,
        "pid": 0,
        "code": 10001,
        "name": "顾洋",
        "allScore": '82',
        'childData': [{
            time: '2019.1',
            type: '参会',
            integral: '11',
        }, {
            time: '2019.',
            type: '改进型',
            integral: '15',
        }]
    },
    {
        "id": 3,
        "pid": 0,
        "code": 10003,
        "name": "文丽",
        "allScore": '72',
        'childData': [{
            time: '2019.2',
            type: '参会',
            integral: '11',
        }, {
            time: '2019.3',
            type: '改进型',
            integral: '15',
        }]
    },
    {
        "id": 4,
        "pid": 0,
        "code": 10004,
        "name": "易芳",
        "allScore": '85',
        'childData': [{
            time: '2019.2',
            type: '参会',
            integral: '11',
        }, {
            time: '2019.3',
            type: '改进型',
            integral: '15',
        }]
    },
    {
        "id": 5,
        "pid": 0,
        "code": 10005,
        "name": "魏强",
        "allScore": '87',
        'childData': [{
            time: '2019.2',
            type: '参会',
            integral: '11',
        }, {
            time: '2019.3',
            type: '改进型',
            integral: '15',
        }]
    },
    {
        "id": 6,
        "pid": 0,
        "code": 10006,
        "name": "韩芳",
        "allScore": '97',
        'childData': [{
            time: '2019.2',
            type: '参会',
            integral: '11',
        }, {
            time: '2019.3',
            type: '改进型',
            integral: '15',
        }]
    },

];

// 培训归档
var $TrainingArchive = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            //删除
            case '/api/TrainingArchive/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $TrainingArchive.EquipmenFacilities.length; i++) {
                        temp.push($TrainingArchive.EquipmenFacilities[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $TrainingArchive.EquipmenFacilities.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/TrainingArchive/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($TrainingArchive.EquipmenFacilities.length == 0) {
                            $TrainingArchive.InitArray();
                        }
                        var p = JSON.parse(options.body);

                        var name = p.model.name;
                        var year = p.model.year;
                        var yOrN = p.model.yOrN;
                        //分页
                        var offset = p.offset;
                        var limit = p.limit;
                        var limitUsers2 = [];
                        for (var i = 0; i < $TrainingArchive.EquipmenFacilities.length; i++) {
                            var user = $TrainingArchive.EquipmenFacilities[i];

                            if (name && user.name.indexOf(name) == -1)
                                continue;
                            if (year && user.year.indexOf(year) == -1)
                                continue;
                            if (yOrN && user.yOrN.indexOf(yOrN) == -1)
                                continue;

                            limitUsers2.push(user);
                        };
                        var limitUsers = [];
                        for (var i = 0; i < limitUsers2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitUsers.push(limitUsers2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitUsers,
                                rowCount: limitUsers2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/TrainingArchive/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myUsers = parent.$TrainingArchive.EquipmenFacilities;
                    var myuser;
                    for (var i = 0; i < myUsers.length; i++) {
                        var testingcomentList = myUsers[i].TestingcomentList;
                        for (var j = 0; j < testingcomentList.length; j++) {
                            var testingcomentItem = testingcomentList[j]
                            if (testingcomentItem.id == vueApp.id) {
                                myuser = testingcomentItem;
                                break;
                            }
                        }
                        if (myuser)
                            break
                    }
                    // for (var i = 0; i < myUsers.length; i++) {
                    //     if (myUsers[i].id == vueApp.id) {
                    //         myuser = myUsers[i];
                    //         break;
                    //     }
                    // }  
                    return {
                        result: "Success",
                        message: null,
                        data: myuser
                    };
                });
                break;
                //获取Input数据
            case '/api/TrainingArchive/getParents':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myUsers = parent.$TrainingArchive.EquipmenFacilities;
                    var myuser;
                    // for (var i = 0; i < myUsers.length; i++) {
                    //     var testingcomentList = myUsers[i].TestingcomentList;
                    //     for (var j = 0; j < testingcomentList.length; j++) {
                    //         var testingcomentItem = testingcomentList[j]
                    //         if (testingcomentItem.id == vueApp.id) {
                    //             myuser = testingcomentItem;
                    //             break;
                    //         }
                    //     }
                    //     if (myuser)
                    //         break
                    // }
                    for (var i = 0; i < myUsers.length; i++) {
                        if (myUsers[i].id == vueApp.id) {
                            myuser = myUsers[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myuser
                    };
                });
                break;
            case '/api/TrainingArchive/getAdd':
                Mock.mock(host + url + '?' + param, type, function (options) {

                    var myUsers = parent.$TrainingArchive.EquipmenFacilities;
                    myuser = {};
                    for (var i = 0; i < myUsers.length; i++) {
                        if (myUsers[i].id == vueApp.id) {
                            myuser = myUsers[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myuser
                    };
                });
                break;



                ////提交
            case '/api/TrainingArchive/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisuser = JSON.parse(options.body);
                    var thisUsers = parent.$TrainingArchive.EquipmenFacilities;
                    var cz = true;
                    for (var i = 0; i < thisUsers.length; i++) {
                        var obj = thisUsers[i].TestingcomentList;
                        for (var j = 0; j < obj.length; j++) {
                            var testingcomentItem = obj[j];
                            if (thisuser.id == testingcomentItem.id) {
                                testingcomentItem.itemScore = thisuser.itemScore;
                                testingcomentItem.scope = thisuser.scope;
                                cz = false;
                                break;
                            }
                        }
                        if (cz == false) {
                            break;
                        }
                    }
                    if (cz) {
                        for (var i = 0; i < thisUsers.length; i++) {
                            if (thisuser.id == thisUsers[i].id) {
                                var list = {};
                                list.itemScore = thisuser.itemScore;
                                list.scope = thisuser.scope;
                                list.id = Mock.Random.id();
                                list.Pid = thisuser.id;
                                thisUsers[i].TestingcomentList.push(list);
                            }
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                ////提交
            case '/api/TrainingArchive/SaveUser':
                Mock.mock(host + url, type, function (options) {
                    var thisuser = JSON.parse(options.body);
                    var thisUsers = parent.$TrainingArchive.EquipmenFacilities;
                    var cz = true;
                    for (var i = 0; i < thisUsers.length; i++) {
                        if (thisUsers[i].id == thisuser.id) {
                            thisUsers[i].name = thisuser.name;
                            thisUsers[i].goalScore = thisuser.goalScore;
                            cz = false;
                            break;
                        }
                        // alert()
                    }
                    if (cz) {
                        parent.$TrainingArchive.EquipmenFacilities.push({
                            id: thisuser.id,
                            name: thisuser.name,
                            goalScore: thisuser.goalScore,
                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    EquipmenFacilities: [],
    InitArray: function () {
        for (var i = 0; i < 30; i++) {
            var Id = Mock.Random.id();
            $TrainingArchive.EquipmenFacilities.push(Mock.mock({
                id: Id,
                name: Mock.Random.cname(),
                allScore: Mock.mock({
                    "number|1-12": 10
                }).number,
                goalScore: Mock.mock({
                    "number|6-10": 10
                }).number,
                yOrN: randomValue('50'),
                year: randomValue('w1'),
                TestingcomentList: [{
                    itemScore: randomValue('w63'),
                    scope: 4,
                    id: Mock.Random.id(),
                    Pid: Id
                }, {
                    itemScore: randomValue('w63'),
                    scope: 5,
                    id: Mock.Random.id(),
                    Pid: Id
                }],
            }));
        }
    }
}

var myTreeTraining = [{
        "id": 1,
        "pid": 0,
        "name": "根节点",
    },
    {
        "id": 2,
        "pid": 1,
        "name": "圣奥化学",
    },
    {
        "id": 3,
        "pid": 1,
        "name": "圣奥曹县",
    },
    {
        "id": 4,
        "pid": 1,
        "name": "圣奥铜陵",
    }
];

// 安全管理师培训管理
var $SafetyManagerTraining = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            //删除
            case '/api/SafetyManagerTraining/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $SafetyManagerTraining.EquipmenFacilities.length; i++) {
                        temp.push($SafetyManagerTraining.EquipmenFacilities[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $SafetyManagerTraining.EquipmenFacilities.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/SafetyManagerTraining/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($SafetyManagerTraining.EquipmenFacilities.length == 0) {
                            $SafetyManagerTraining.InitArray();
                        }
                        var p = JSON.parse(options.body);

                        var name = p.model.name;
                        var type = p.model.type;
                        var trainedNumber = p.model.trainedNumber;
                        var trainMain = p.model.trainMain;
                        var trainMain = p.model.trainMain;
                        var trainTimeStart = p.model.trainTimeStart;
                        var trainTimeEnd = p.model.trainTimeEnd;
                        //分页
                        var TreeNode = p.model.TreeNode;
                        var offset = p.offset;
                        var limit = p.limit;
                        var limitUsers2 = [];
                        for (var i = 0; i < $SafetyManagerTraining.EquipmenFacilities.length; i++) {
                            var user = $SafetyManagerTraining.EquipmenFacilities[i];

                            if (name && user.name.indexOf(name) == -1)
                                continue;
                            if (type && user.type.indexOf(type) == -1)
                                continue;
                            if (trainedNumber && user.trainedNumber.indexOf(trainedNumber) == -1)
                                continue;

                            if (TreeNode && user.TreeNode.indexOf(TreeNode) == -1)
                                continue;

                            if (trainTimeStart && trainTimeStart >= user.lastTrainTime)
                                continue;
                            if (trainTimeEnd && trainTimeEnd <= user.lastTrainTime)
                                continue;
                            var array = [];
                            for (var j = 0; j < user.TestingcomentList.length; j++) {
                                // alert(user.TestingcomentList[j].trainMain)
                                if (trainMain && user.TestingcomentList[j].trainMain.indexOf(trainMain) == -1)
                                    continue;
                                array.push(user.TestingcomentList[j])
                                //limitUsers2.push(user);

                            }
                            if (array.length == 0) {
                                continue;
                            }
                            user.TestingcomentList = array;
                            limitUsers2.push(user);
                        };
                        var limitUsers = [];
                        for (var i = 0; i < limitUsers2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitUsers.push(limitUsers2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitUsers,
                                rowCount: limitUsers2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/SafetyManagerTraining/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myUsers = parent.$SafetyManagerTraining.EquipmenFacilities;
                    var myuser;
                    for (var i = 0; i < myUsers.length; i++) {
                        var testingcomentList = myUsers[i].TestingcomentList;
                        for (var j = 0; j < testingcomentList.length; j++) {
                            var testingcomentItem = testingcomentList[j]
                            if (testingcomentItem.id == vueApp.id) {
                                myuser = testingcomentItem;
                                break;
                            }
                        }
                        if (myuser)
                            break
                    }
                    // for (var i = 0; i < myUsers.length; i++) {
                    //     if (myUsers[i].id == vueApp.id) {
                    //         myuser = myUsers[i];
                    //         break;
                    //     }
                    // }  
                    return {
                        result: "Success",
                        message: null,
                        data: myuser
                    };
                });
                break;
                //获取Input数据
            case '/api/SafetyManagerTraining/getParents':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myUsers = parent.$SafetyManagerTraining.EquipmenFacilities;
                    var myuser;
                    // for (var i = 0; i < myUsers.length; i++) {
                    //     var testingcomentList = myUsers[i].TestingcomentList;
                    //     for (var j = 0; j < testingcomentList.length; j++) {
                    //         var testingcomentItem = testingcomentList[j]
                    //         if (testingcomentItem.id == vueApp.id) {
                    //             myuser = testingcomentItem;
                    //             break;
                    //         }
                    //     }
                    //     if (myuser)
                    //         break
                    // }
                    for (var i = 0; i < myUsers.length; i++) {
                        if (myUsers[i].id == vueApp.id) {
                            myuser = myUsers[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myuser
                    };
                });
                break;
            case '/api/SafetyManagerTraining/getAdd':
                Mock.mock(host + url + '?' + param, type, function (options) {

                    var myUsers = parent.$SafetyManagerTraining.EquipmenFacilities;
                    myuser = {};
                    for (var i = 0; i < myUsers.length; i++) {
                        if (myUsers[i].id == vueApp.id) {
                            myuser = myUsers[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myuser
                    };
                });
                break;



                ////提交
            case '/api/SafetyManagerTraining/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisuser = JSON.parse(options.body);
                    var thisUsers = parent.$SafetyManagerTraining.EquipmenFacilities;
                    var cz = true;
                    for (var i = 0; i < thisUsers.length; i++) {
                        var obj = thisUsers[i].TestingcomentList;
                        for (var j = 0; j < obj.length; j++) {
                            var testingcomentItem = obj[j];
                            if (thisuser.id == testingcomentItem.id) {
                                testingcomentItem.trainMain = thisuser.trainMain;
                                testingcomentItem.local = thisuser.local;
                                testingcomentItem.trainTime = thisuser.trainTime;
                                cz = false;
                                break;
                            }
                        }
                        if (cz == false) {
                            break;
                        }
                    }
                    if (cz) {
                        for (var i = 0; i < thisUsers.length; i++) {
                            if (thisuser.id == thisUsers[i].id) {
                                var list = {};
                                list.trainMain = thisuser.trainMain;
                                list.local = thisuser.local;
                                list.trainTime = thisuser.trainTime;
                                list.id = Mock.Random.id();
                                list.Pid = thisuser.id;
                                thisUsers[i].TestingcomentList.push(list);
                            }
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                ////提交
            case '/api/SafetyManagerTraining/SaveUser':
                Mock.mock(host + url, type, function (options) {
                    var thisuser = JSON.parse(options.body);
                    var thisUsers = parent.$SafetyManagerTraining.EquipmenFacilities;
                    var cz = true;
                    for (var i = 0; i < thisUsers.length; i++) {
                        if (thisUsers[i].id == thisuser.id) {
                            thisUsers[i].name = thisuser.name;
                            thisUsers[i].type = thisuser.type;
                            thisUsers[i].trainedNumber = thisuser.trainedNumber;
                            thisUsers[i].lastTrainTime = thisuser.lastTrainTime;
                            thisUsers[i].TreeNode = thisuser.TreeNode;
                            cz = false;
                            break;
                        }
                        // alert()
                    }
                    if (cz) {
                        parent.$SafetyManagerTraining.EquipmenFacilities.push({
                            id: thisuser.id,
                            name: thisuser.name,
                            type: thisuser.type,
                            trainedNumber: thisuser.trainedNumber,
                            lastTrainTime: thisuser.lastTrainTime,
                            TreeNode: thisuser.TreeNode,
                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    EquipmenFacilities: [],
    InitArray: function () {
        for (var i = 0; i < 30; i++) {
            var Id = Mock.Random.id();
            $SafetyManagerTraining.EquipmenFacilities.push(Mock.mock({
                id: Id,
                name: Mock.Random.cname(),
                type: randomValue('50'),
                qualifiedTrainNumber: Mock.mock({
                    "number|1-12": 10
                }).number,
                trainedNumber: randomValue('94'),
                lastTrainTime: Mock.mock('@datetime'),
                // yOrN: "否",
                year: randomValue('w1'),
                TestingcomentList: [{
                    trainMain: randomValue('w63'),
                    local: "泰安工厂1#培训室",
                    trainTime: Mock.mock('@datetime'),
                    id: Mock.Random.id(),
                    Pid: Id
                }, {
                    trainMain: randomValue('w63'),
                    local: "泰安工厂2#培训室",
                    trainTime: Mock.mock('@datetime'),
                    id: Mock.Random.id(),
                    Pid: Id
                }],
                TreeNode: randomTreeNode(myTreeTraining)
            }));
        }
    }
}

//办公安全分委会积分考核数据-员工
var PersonInChargeTree = [{
        "id": 100,
        "pid": 0,
        "name": "总经理"
    },
    {
        "id": 200,
        "pid": 0,
        "name": "生产部"
    },
    {
        "id": 300,
        "pid": 0,
        "name": "技术科"
    },
    {
        "id": 400,
        "pid": 0,
        "name": "工程设备科"
    },
    {
        "id": 100001,
        "pid": 100,
        "name": "张三"
    },
    {
        "id": 100002,
        "pid": 100,
        "name": "李四"
    },
    {
        "id": 200001,
        "pid": 200,
        "name": "胡伟"
    },
    {
        "id": 200002,
        "pid": 200,
        "name": "胡博"
    },
    {
        "id": 300001,
        "pid": 300,
        "name": "李师伯"
    },
    {
        "id": 300002,
        "pid": 300,
        "name": "康师傅"
    },
    {
        "id": 400001,
        "pid": 400,
        "name": "王二"
    },
]


//委员会董事
var myTree = [{
        "id": 1,
        "pid": 0,
        "name": "委员会董事",
    },
    {
        "id": 2,
        "pid": 1,
        "name": "秘书",
    },
    {
        "id": 3,
        "pid": 2,
        "name": "成员",
    }
];

function randomTreeNode(tree, pid, b) {
    var result = '';
    var tempArray = [];
    if (!b) {
        var idArray = [];
        var pidArray = [];
        tree.forEach(function (v, i) {
            if (pid) {
                if (pid == v.pid) {
                    idArray.push(v.id);
                    pidArray.push(v.pid);
                }
            } else {
                idArray.push(v.id);
                pidArray.push(v.pid);
            }
        })
        tempArray = idArray.filter(function (v) {
            return pidArray.indexOf(v) === -1
        });
        result = tempArray[Math.floor(Math.random() * tempArray.length)] + '';
    } else {
        tree.forEach(function (v, i) {
            if (v.pid + '' == '0') {
                tempArray.push(v.id);
            }
        })
        result = tempArray[Math.floor(Math.random() * tempArray.length)] + '';
    }
    return result;
}
//根据tree数据中的id获取对应的name值
function getTreeValue(tree, id) {
    var value = '';
    tree.forEach(function (v, i) {
        if (v.id + '' == id + '') {
            value = v.name;
            return;
        }
    })
    return value;
}
//树型数据扁平化处理
function fnCommon(data, pid) {
    var result = [],
        temp;
    data.forEach(function (v, i) {
        if (v.pid == pid) {
            var obj = {};
            for (var key in v) {
                obj[key] = v[key];
            }
            temp = this.fnCommon(data, data[i].id);
            if (temp.length > 0) {
                obj.children = temp;
            }
            result.push(obj);
        }
    })
    return result
}
//对应fnCommon的删除事件
function onDeleteForTree(mythis, url) {
    if (mythis.ListItem.tableMultipleSelection.length == 0) {

        showMessage(msg.AtLeastOne, 'error')
        return;
    }
    mythis.$confirm(' 是否确认继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
    }).then(function () {
        var delIds = [];
        for (var i = 0; i < mythis.ListItem.tableMultipleSelection.length; i++) {
            var item = mythis.ListItem.tableMultipleSelection[i];
            delIds.push(item.id);
        }
        var temp = [];
        for (var i = 0; i < mythis.mydata.length; i++) {
            temp.push(mythis.mydata[i]);
        }
        for (var i = 0; i < temp.length; i++) {
            if (delIds.includes(temp[i].id)) {
                mythis.mydata.splice(i, 1);
            }
        }
        mythis.TreeTable = fnCommon(mythis.mydata, "0");
        showMessage(msg.OperatingOk, "success");

    }).catch(function () {
        showMessage("已取消删除!");
    });

}

// 安委会会议纪要历史查询
var $HistoricalinquiriesonminutesofSecurityCommitteemeetings = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            ////删除
            case '/api/HistoricalinquiriesonminutesofSecurityCommitteemeetings/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $HistoricalinquiriesonminutesofSecurityCommitteemeetings.Arrays.length; i++) {
                        temp.push($HistoricalinquiriesonminutesofSecurityCommitteemeetings.Arrays[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $HistoricalinquiriesonminutesofSecurityCommitteemeetings.Arrays.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/HistoricalinquiriesonminutesofSecurityCommitteemeetings/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($HistoricalinquiriesonminutesofSecurityCommitteemeetings.Arrays.length == 0) {
                            $HistoricalinquiriesonminutesofSecurityCommitteemeetings.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //查询条件 写自己的查询条件 
                        var Conferencetitle = p.model.Conferencetitle;
                        var DateofadditionStart = p.model.DateofadditionStart;
                        var DateofadditionEnd = p.model.DateofadditionEnd;
                        //分页条件
                        var offset = p.offset;
                        var limit = p.limit;
                        //查询条件 按自己实际的去过滤
                        var limitArrays2 = [];
                        for (var i = 0; i < $HistoricalinquiriesonminutesofSecurityCommitteemeetings.Arrays.length; i++) {
                            var HistoricalinquiriesonminutesofSecurityCommitteemeetings = $HistoricalinquiriesonminutesofSecurityCommitteemeetings.Arrays[i];
                            if (Conferencetitle && HistoricalinquiriesonminutesofSecurityCommitteemeetings.Conferencetitle.indexOf(Conferencetitle) == -1)
                                continue;
                            if (DateofadditionStart && DateofadditionStart >= HistoricalinquiriesonminutesofSecurityCommitteemeetings.Dateofaddition)
                                continue;
                            if (DateofadditionEnd && DateofadditionEnd <= HistoricalinquiriesonminutesofSecurityCommitteemeetings.Dateofaddition)
                                continue;
                            limitArrays2.push(HistoricalinquiriesonminutesofSecurityCommitteemeetings);
                        }
                        var limitArrays = [];
                        for (var i = 0; i < limitArrays2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitArrays.push(limitArrays2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitArrays,
                                rowCount: limitArrays2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/HistoricalinquiriesonminutesofSecurityCommitteemeetings/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myArrays = parent.$HistoricalinquiriesonminutesofSecurityCommitteemeetings.Arrays;
                    myarray = {};
                    for (var i = 0; i < myArrays.length; i++) {
                        if (myArrays[i].id == vueApp.id) {
                            myarray = myArrays[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myarray
                    };
                });
                break;
                //提交
            case '/api/HistoricalinquiriesonminutesofSecurityCommitteemeetings/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    var thisArrays = parent.$HistoricalinquiriesonminutesofSecurityCommitteemeetings.Arrays;
                    var cz = true;
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].Dateofaddition = thisentity.Dateofaddition;
                            thisArrays[i].Conferencetitle = thisentity.Conferencetitle;
                            thisArrays[i].Addpeople = thisentity.Addpeople;
                            thisArrays[i].Conferencecontent = thisentity.Conferencecontent;
                            thisArrays[i].file = thisentity.file;

                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$HistoricalinquiriesonminutesofSecurityCommitteemeetings.Arrays.push({
                            id: thisentity.id,
                            Dateofaddition: thisentity.Dateofaddition,
                            Conferencetitle: thisentity.Conferencetitle,
                            Addpeople: thisentity.Addpeople,
                            Conferencecontent: thisentity.Conferencecontent,
                            file: thisentity.file,

                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            //注意  随机数据初始都是随机姓名，需要自己手动调整
            $HistoricalinquiriesonminutesofSecurityCommitteemeetings.Arrays.push(Mock.mock({
                id: Mock.Random.id(), //必须有
                Dateofaddition: Mock.Random.date(), //添加日期
                Conferencetitle: randomValue('20'), //会议标题
                Addpeople: Mock.Random.cname(), //添加人
                Conferencecontent: randomValue('21'), //会议内容
                // 'score|70-100': 1,
                score: Mock.Random.string('number', 2),
                name: Mock.Random.cname(),
                remarks: Mock.mock('@county(true)'),
                file: randomValue('n58'),
            }));

        }
    }
}


// 安委会会议纪要历史查询
var $EmployeeInformationManagement = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            ////删除
            case '/api/EmployeeInformationManagement/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $EmployeeInformationManagement.Arrays.length; i++) {
                        temp.push($EmployeeInformationManagement.Arrays[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $EmployeeInformationManagement.Arrays.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/EmployeeInformationManagement/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($EmployeeInformationManagement.Arrays.length == 0) {
                            $EmployeeInformationManagement.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //查询条件 写自己的查询条件 
                        var Employeename = p.model.Employeename;
                        var department = p.model.department;
                        var DateofentryStar = p.model.DateofentryStar;
                        var DateofentryEnd = p.model.DateofentryEnd;
                        //分页条件
                        var offset = p.offset;
                        var limit = p.limit;
                        //查询条件 按自己实际的去过滤
                        var limitArrays2 = [];
                        for (var i = 0; i < $EmployeeInformationManagement.Arrays.length; i++) {
                            var EmployeeInformationManagement = $EmployeeInformationManagement.Arrays[i];
                            if (Employeename && EmployeeInformationManagement.Employeename.indexOf(Employeename) == -1)
                                continue;
                            if (department && EmployeeInformationManagement.department.indexOf(department) == -1)
                                continue;
                            if (DateofentryStar && DateofentryStar >= EmployeeInformationManagement.Dateofentry)
                                continue;
                            if (DateofentryEnd && DateofentryEnd <= EmployeeInformationManagement.Dateofentry)
                                continue;
                            limitArrays2.push(EmployeeInformationManagement);
                        }
                        var limitArrays = [];
                        for (var i = 0; i < limitArrays2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitArrays.push(limitArrays2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitArrays,
                                rowCount: limitArrays2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/EmployeeInformationManagement/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myArrays = parent.$EmployeeInformationManagement.Arrays;
                    myarray = {};
                    for (var i = 0; i < myArrays.length; i++) {
                        if (myArrays[i].id == vueApp.id) {
                            myarray = myArrays[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myarray
                    };
                });
                break;
                //提交
            case '/api/EmployeeInformationManagement/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    var thisArrays = parent.$EmployeeInformationManagement.Arrays;
                    var cz = true;
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].Employeename = thisentity.Employeename;
                            thisArrays[i].Dateofentry = thisentity.Dateofentry;
                            thisArrays[i].Founder = thisentity.Founder;
                            thisArrays[i].department = thisentity.department;
                            thisArrays[i].position = thisentity.position;
                            thisArrays[i].Telephonecontact = thisentity.Telephonecontact;
                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$EmployeeInformationManagement.Arrays.push({
                            id: thisentity.id,
                            Employeename: thisentity.Employeename,
                            Dateofentry: thisentity.Dateofentry,
                            Founder: thisentity.Founder,
                            department: thisentity.department,
                            position: thisentity.position,
                            Telephonecontact: thisentity.Telephonecontact,
                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            //注意  随机数据初始都是随机姓名，需要自己手动调整
            $EmployeeInformationManagement.Arrays.push(Mock.mock({
                id: Mock.Random.id(), //必须有
                Employeename: Mock.Random.cname(), //员工名称
                Dateofentry: Mock.Random.date(), //入职日期
                Founder: Mock.Random.cname(), //创建人
                department: randomValue('111'), //部门
                position: randomValue('n84'), //职位
                Telephonecontact: randomValue('n64'), //电话联系
                Conferencecontent: randomValue('19'), //会议内容
                // 'score|70-100': 1,
                score: Mock.Random.string('number', 2),
                name: Mock.Random.cname(),
                remarks: Mock.mock('@county(true)'),
            }));

        }
    }
}

// 安全经验分享库
var $SecurityExperienceSharingLibrary = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            ////删除
            case '/api/SecurityExperienceSharingLibrary/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $SecurityExperienceSharingLibrary.Arrays.length; i++) {
                        temp.push($SecurityExperienceSharingLibrary.Arrays[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $SecurityExperienceSharingLibrary.Arrays.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/SecurityExperienceSharingLibrary/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($SecurityExperienceSharingLibrary.Arrays.length == 0) {
                            $SecurityExperienceSharingLibrary.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //查询条件 写自己的查询条件 
                        var Name = p.model.Name;
                        var Addpeople = p.model.Addpeople;
                        var DateofadditionStart = p.model.DateofadditionStart;
                        var DateofadditionEnd = p.model.DateofadditionEnd;
                        //分页条件
                        var offset = p.offset;
                        var limit = p.limit;
                        //查询条件 按自己实际的去过滤
                        var limitArrays2 = [];
                        for (var i = 0; i < $SecurityExperienceSharingLibrary.Arrays.length; i++) {
                            var SecurityExperienceSharingLibrary = $SecurityExperienceSharingLibrary.Arrays[i];
                            if (Name && SecurityExperienceSharingLibrary.Name.indexOf(Name) == -1)
                                continue;
                            if (Addpeople && SecurityExperienceSharingLibrary.Addpeople.indexOf(Addpeople) == -1)
                                continue;

                            if (DateofadditionStart && DateofadditionStart >= SecurityExperienceSharingLibrary.Dateofaddition)
                                continue;
                            if (DateofadditionEnd && DateofadditionEnd <= SecurityExperienceSharingLibrary.Dateofaddition)
                                continue;
                            limitArrays2.push(SecurityExperienceSharingLibrary);
                        }
                        var limitArrays = [];
                        for (var i = 0; i < limitArrays2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitArrays.push(limitArrays2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitArrays,
                                rowCount: limitArrays2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/SecurityExperienceSharingLibrary/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myArrays = parent.$SecurityExperienceSharingLibrary.Arrays;
                    myarray = {};
                    for (var i = 0; i < myArrays.length; i++) {
                        if (myArrays[i].id == vueApp.id) {
                            myarray = myArrays[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myarray
                    };
                });
                break;
                //提交
            case '/api/SecurityExperienceSharingLibrary/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    var thisArrays = parent.$SecurityExperienceSharingLibrary.Arrays;
                    var cz = true;
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].Name = thisentity.Name;
                            thisArrays[i].Dateofaddition = thisentity.Dateofaddition;
                            thisArrays[i].Addpeople = thisentity.Addpeople;

                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$SecurityExperienceSharingLibrary.Arrays.push({
                            id: thisentity.id,
                            Name: thisentity.Name,
                            Dateofaddition: thisentity.Dateofaddition,
                            Addpeople: thisentity.Addpeople,

                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            //注意  随机数据初始都是随机姓名，需要自己手动调整
            $SecurityExperienceSharingLibrary.Arrays.push(Mock.mock({
                id: Mock.Random.id(), //必须有
                Name: "Material Safety Data Sheet", //员工名称
                Dateofaddition: Mock.Random.date(), //入职日期
                Addpeople: Mock.Random.cname(), //创建人
                fileItem: "Material Safety Data Sheet.pdf", //创建人

            }));

        }
    }
}

// 产品MSDS数据库
var $ProductMSDSdatabase = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            ////删除
            case '/api/ProductMSDSdatabase/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $ProductMSDSdatabase.Arrays.length; i++) {
                        temp.push($ProductMSDSdatabase.Arrays[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $ProductMSDSdatabase.Arrays.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/ProductMSDSdatabase/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($ProductMSDSdatabase.Arrays.length == 0) {
                            $ProductMSDSdatabase.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //查询条件 写自己的查询条件 
                        var Name = p.model.Name;
                        var Productname = p.model.Productname;
                        var company = p.model.company;
                        var DateofadditionStart = p.model.DateofadditionStart;
                        var DateofadditionEnd = p.model.DateofadditionEnd;
                        //分页条件
                        var offset = p.offset;
                        var limit = p.limit;
                        //查询条件 按自己实际的去过滤
                        var limitArrays2 = [];
                        for (var i = 0; i < $ProductMSDSdatabase.Arrays.length; i++) {
                            var ProductMSDSdatabase = $ProductMSDSdatabase.Arrays[i];
                            if (Name && ProductMSDSdatabase.Name.indexOf(Name) == -1)
                                continue;
                            if (Productname && ProductMSDSdatabase.Productname.indexOf(Productname) == -1)
                                continue;
                            if (company && ProductMSDSdatabase.company.indexOf(company) == -1)
                                continue;

                            if (DateofadditionStart && DateofadditionStart >= ProductMSDSdatabase.Dateofaddition)
                                continue;
                            if (DateofadditionEnd && DateofadditionEnd <= ProductMSDSdatabase.Dateofaddition)
                                continue;
                            limitArrays2.push(ProductMSDSdatabase);
                        }
                        var limitArrays = [];
                        for (var i = 0; i < limitArrays2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitArrays.push(limitArrays2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitArrays,
                                rowCount: limitArrays2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/ProductMSDSdatabase/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myArrays = parent.$ProductMSDSdatabase.Arrays;
                    myarray = {};
                    for (var i = 0; i < myArrays.length; i++) {
                        if (myArrays[i].id == vueApp.id) {
                            myarray = myArrays[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myarray
                    };
                });
                break;
                //提交
            case '/api/ProductMSDSdatabase/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    var thisArrays = parent.$ProductMSDSdatabase.Arrays;
                    var cz = true;
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].Name = thisentity.Name;
                            thisArrays[i].Country = thisentity.Country;
                            thisArrays[i].Productname = thisentity.Productname;
                            thisArrays[i].company = thisentity.company;
                            thisArrays[i].DangerousGoods = thisentity.DangerousGoods;
                            thisArrays[i].Isitdangerous = thisentity.Isitdangerous;
                            thisArrays[i].Dateofaddition = thisentity.Dateofaddition;
                            thisArrays[i].Addpeople = thisentity.Addpeople;
                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$ProductMSDSdatabase.Arrays.push({
                            id: thisentity.id,
                            Name: thisentity.Name,
                            Country: thisentity.Country,
                            Productname: thisentity.Productname,
                            company: thisentity.company,
                            DangerousGoods: thisentity.DangerousGoods,
                            Isitdangerous: thisentity.Isitdangerous,
                            Dateofaddition: thisentity.Dateofaddition,
                            Addpeople: thisentity.Addpeople,
                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            //注意  随机数据初始都是随机姓名，需要自己手动调整
            $ProductMSDSdatabase.Arrays.push(Mock.mock({
                id: Mock.Random.id(), //必须有
                Name: "Material Safety Data Sheet", //名称
                Country: randomValue('n65'), //国家
                Productname: randomValue('06'), //产品名
                company: randomValue('139'), //公司
                DangerousGoods: randomValue('50'), //是否危险
                Isitdangerous: randomValue('50'), //是否危险
                
                VersionDate: Mock.Random.date(), //版本日期
                VersionNum: Mock.mock({
                    "number|1000000000-9999999999": 9999999999
                  }).number, //版本号
                CoursewareNum: Mock.mock({
                    "number|1000000000-9999999999": 9999999999
                  }).number, //文件编号
                Language: randomValue('n97'), //语言

                Dateofaddition: Mock.Random.date(), //添加日期
                Addpeople: Mock.Random.cname(), //添加人
                // 'score|70-100': 1,
                score: Mock.Random.string('number', 2),
                name: Mock.Random.cname(),
                remarks: Mock.mock('@county(true)'),
                Courseware: "Material Safety Data Sheet.pdf"
            }));

        }
    }
}

// 工厂运营类HSE合规类证书库
var $HSEComplianceCertificateLibraryforFactoryOperations = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            ////删除
            case '/api/HSEComplianceCertificateLibraryforFactoryOperations/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $HSEComplianceCertificateLibraryforFactoryOperations.Arrays.length; i++) {
                        temp.push($HSEComplianceCertificateLibraryforFactoryOperations.Arrays[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $HSEComplianceCertificateLibraryforFactoryOperations.Arrays.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/HSEComplianceCertificateLibraryforFactoryOperations/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($HSEComplianceCertificateLibraryforFactoryOperations.Arrays.length == 0) {
                            $HSEComplianceCertificateLibraryforFactoryOperations.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //查询条件 写自己的查询条件 
                        var Name = p.model.Name;
                        var DateofadditionStart = p.model.DateofadditionStart;
                        var DateofadditionEnd = p.model.DateofadditionEnd;

                        //分页条件
                        var offset = p.offset;
                        var limit = p.limit;
                        //查询条件 按自己实际的去过滤
                        var limitArrays2 = [];
                        for (var i = 0; i < $HSEComplianceCertificateLibraryforFactoryOperations.Arrays.length; i++) {
                            var HSEComplianceCertificateLibraryforFactoryOperations = $HSEComplianceCertificateLibraryforFactoryOperations.Arrays[i];
                            if (Name && HSEComplianceCertificateLibraryforFactoryOperations.Name.indexOf(Name) == -1)
                                continue;
                            if (DateofadditionStart && DateofadditionStart >= HSEComplianceCertificateLibraryforFactoryOperations.Dateofaddition)
                                continue;
                            if (DateofadditionEnd && DateofadditionEnd <= HSEComplianceCertificateLibraryforFactoryOperations.Dateofaddition)
                                continue;
                            limitArrays2.push(HSEComplianceCertificateLibraryforFactoryOperations);
                        }
                        var limitArrays = [];
                        for (var i = 0; i < limitArrays2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitArrays.push(limitArrays2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitArrays,
                                rowCount: limitArrays2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/HSEComplianceCertificateLibraryforFactoryOperations/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myArrays = parent.$HSEComplianceCertificateLibraryforFactoryOperations.Arrays;
                    myarray = {};
                    for (var i = 0; i < myArrays.length; i++) {
                        if (myArrays[i].id == vueApp.id) {
                            myarray = myArrays[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myarray
                    };
                });
                break;
                //提交
            case '/api/HSEComplianceCertificateLibraryforFactoryOperations/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    var thisArrays = parent.$HSEComplianceCertificateLibraryforFactoryOperations.Arrays;
                    var cz = true;
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].Name = thisentity.Name;
                            thisArrays[i].Dateofaddition = thisentity.Dateofaddition;
                            thisArrays[i].Effectivedate = thisentity.Effectivedate;
                            thisArrays[i].Addpeople = thisentity.Addpeople;

                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$HSEComplianceCertificateLibraryforFactoryOperations.Arrays.push({
                            id: thisentity.id,
                            Name: thisentity.Name,
                            Dateofaddition: thisentity.Dateofaddition,
                            Effectivedate: thisentity.Effectivedate,
                            Addpeople: thisentity.Addpeople,

                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            //注意  随机数据初始都是随机姓名，需要自己手动调整
            $HSEComplianceCertificateLibraryforFactoryOperations.Arrays.push(Mock.mock({
                id: Mock.Random.id(), //必须有
                Name: "Material Safety Data Sheet", //名称
                Courseware: "Material Safety Data Sheet.pdf", //名称
                Dateofaddition: Mock.Random.date(), //添加日期
                Effectivedate: Mock.Random.date(), //有效日期
                Addpeople: randomValue('02'), //添加人

                // 'score|70-100': 1,
                score: Mock.Random.string('number', 2),
                name: Mock.Random.cname(),
                remarks: Mock.mock('@county(true)'),
            }));

        }
    }
}

// 我的培训课程
var $Addingtraininginformation = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            ////删除
            case '/api/Addingtraininginformation/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $Addingtraininginformation.Arrays.length; i++) {
                        temp.push($Addingtraininginformation.Arrays[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $Addingtraininginformation.Arrays.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/Addingtraininginformation/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($Addingtraininginformation.Arrays.length == 0) {
                            $Addingtraininginformation.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //查询条件 写自己的查询条件 
                        var Trainingcontents = p.model.Trainingcontents;
                        var TrainingdateStart = p.model.TrainingdateStart;
                        var TrainingdateEnd = p.model.TrainingdateEnd;

                        //分页条件
                        var offset = p.offset;
                        var limit = p.limit;
                        //查询条件 按自己实际的去过滤
                        var limitArrays2 = [];
                        for (var i = 0; i < $Addingtraininginformation.Arrays.length; i++) {
                            var Addingtraininginformation = $Addingtraininginformation.Arrays[i];
                            if (Trainingcontents && Addingtraininginformation.Trainingcontents.indexOf(Trainingcontents) == -1)
                                continue;

                            if (TrainingdateStart && TrainingdateStart >= Addingtraininginformation.Trainingdate)
                                continue;
                            if (TrainingdateEnd && TrainingdateEnd <= Addingtraininginformation.Trainingdate)
                                continue;
                            limitArrays2.push(Addingtraininginformation);
                        }
                        var limitArrays = [];
                        for (var i = 0; i < limitArrays2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitArrays.push(limitArrays2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitArrays,
                                rowCount: limitArrays2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/Addingtraininginformation/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myArrays = parent.$Addingtraininginformation.Arrays;
                    myarray = {};
                    for (var i = 0; i < myArrays.length; i++) {
                        if (myArrays[i].id == vueApp.id) {
                            myarray = myArrays[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myarray
                    };
                });
                break;
                //提交
            case '/api/Addingtraininginformation/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    var thisArrays = parent.$Addingtraininginformation.Arrays;
                    var cz = true;
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].Trainingcontents = thisentity.Trainingcontents;
                            thisArrays[i].Trainingdate = thisentity.Trainingdate;
                            thisArrays[i].Trainingtype = thisentity.Trainingtype;
                            thisArrays[i].Trainingteacher = thisentity.Trainingteacher;
                            thisArrays[i].Whethertoupload = thisentity.Whethertoupload;
                            thisArrays[i].Nameoftrainingplan = thisentity.Nameoftrainingplan;
                            thisArrays[i].Trainingvenue = thisentity.Trainingvenue;
                            thisArrays[i].Trainingobjectives = thisentity.Trainingobjectives;
                            thisArrays[i].Titleoftitle = thisentity.Titleoftitle;
                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$Addingtraininginformation.Arrays.push({
                            id: thisentity.id,
                            Trainingcontents: thisentity.Trainingcontents,
                            Trainingdate: thisentity.Trainingdate,
                            Trainingtype: thisentity.Trainingtype,
                            Trainingteacher: thisentity.Trainingteacher,
                            Whethertoupload: thisentity.Whethertoupload,
                            Nameoftrainingplan: thisentity.Nameoftrainingplan,
                            Trainingvenue: thisentity.Trainingvenue,
                            Trainingobjectives: thisentity.Trainingobjectives,
                            Titleoftitle: thisentity.Titleoftitle,
                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            //注意  随机数据初始都是随机姓名，需要自己手动调整
            $Addingtraininginformation.Arrays.push(Mock.mock({
                id: Mock.Random.id(), //必须有
                Trainingcontents: randomValue('20'), //培训内容
                Trainingdate: Mock.Random.date(), //培训日期
                Trainingvenue: Mock.mock('@county(true)'), //培训地点
                Trainingtype: randomValue('07'), //培训类型
                Trainingteacher: randomValue('02'), //培训老师
                Whethertoupload: randomValue('50'), //是否上传保命条款
                Nameoftrainingplan: randomValue('21'), //培训计划名称
                Trainingvenue: randomValue('10'), //培训地点
                Trainingobjectives: randomValue('07'), //培训目标
                Titleoftitle: randomValue('04'), //题目名称

                // 'score|70-100': 1,
                score: Mock.Random.string('number', 2),
                name: Mock.Random.cname(),
                remarks: Mock.mock('@county(true)'),
            }));

        }
    }
}

// 我的培训记录
var $Mytrainingrecord = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            ////删除
            case '/api/Mytrainingrecord/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $Mytrainingrecord.Arrays.length; i++) {
                        temp.push($Mytrainingrecord.Arrays[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $Mytrainingrecord.Arrays.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/Mytrainingrecord/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($Mytrainingrecord.Arrays.length == 0) {
                            $Mytrainingrecord.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //查询条件 写自己的查询条件 
                        var Topicname = p.model.Topicname;

                        //分页条件
                        var offset = p.offset;
                        var limit = p.limit;
                        //查询条件 按自己实际的去过滤
                        var limitArrays2 = [];
                        for (var i = 0; i < $Mytrainingrecord.Arrays.length; i++) {
                            var Mytrainingrecord = $Mytrainingrecord.Arrays[i];
                            if (Topicname && Mytrainingrecord.Topicname.indexOf(Topicname) == -1)
                                continue;

                            limitArrays2.push(Mytrainingrecord);
                        }
                        var limitArrays = [];
                        for (var i = 0; i < limitArrays2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitArrays.push(limitArrays2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitArrays,
                                rowCount: limitArrays2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/Mytrainingrecord/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myArrays = parent.$Mytrainingrecord.Arrays;
                    myarray = {};
                    for (var i = 0; i < myArrays.length; i++) {
                        if (myArrays[i].id == vueApp.id) {
                            myarray = myArrays[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myarray
                    };
                });
                break;
                //提交
            case '/api/Mytrainingrecord/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    var thisArrays = parent.$Mytrainingrecord.Arrays;
                    var cz = true;
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].Topicname = thisentity.Topicname;
                            thisArrays[i].Scoreitem = thisentity.Scoreitem;
                            thisArrays[i].Score = thisentity.Score;


                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$Mytrainingrecord.Arrays.push({
                            id: thisentity.id,
                            Topicname: thisentity.Topicname,
                            Scoreitem: thisentity.Scoreitem,
                            Score: thisentity.Score,


                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            //注意  随机数据初始都是随机姓名，需要自己手动调整
            $Mytrainingrecord.Arrays.push(Mock.mock({
                id: Mock.Random.id(), //必须有
                Topicname: randomValue('w1'), //课题名称
                Scoreitem: randomValue('20'), //得分项
                Score: Mock.Random.string('number', 2), //得分


                // 'score|70-100': 1,
                score: Mock.Random.string('number', 2),
                name: Mock.Random.cname(),
                remarks: Mock.mock('@county(true)'),
            }));

        }
    }
}

// 待设培训计划员工
var $Stafftobetrained = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            ////删除
            case '/api/Stafftobetrained/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $Stafftobetrained.Arrays.length; i++) {
                        temp.push($Stafftobetrained.Arrays[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $Stafftobetrained.Arrays.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/Stafftobetrained/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($Stafftobetrained.Arrays.length == 0) {
                            $Stafftobetrained.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //查询条件 写自己的查询条件 
                        var Employeeregister = p.model.Employeeregister;
                        var Whethertoupload = p.model.Whethertoupload;
                        var DateofentryStart = p.model.DateofentryStart;
                        var DateofentryEnd = p.model.DateofentryEnd;
                        //分页条件
                        var offset = p.offset;
                        var limit = p.limit;
                        //查询条件 按自己实际的去过滤
                        var limitArrays2 = [];
                        for (var i = 0; i < $Stafftobetrained.Arrays.length; i++) {
                            var Stafftobetrained = $Stafftobetrained.Arrays[i];
                            if (Employeeregister && Stafftobetrained.Employeeregister.indexOf(Employeeregister) == -1)
                                continue;
                            if (Whethertoupload && Stafftobetrained.Whethertoupload.indexOf(Whethertoupload) == -1)
                                continue;
                            if (DateofentryStart && DateofentryStart >= Stafftobetrained.Dateofentry)
                                continue;
                            if (DateofentryEnd && DateofentryEnd <= Stafftobetrained.Dateofentry)
                                continue;
                            limitArrays2.push(Stafftobetrained);
                        }
                        var limitArrays = [];
                        for (var i = 0; i < limitArrays2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitArrays.push(limitArrays2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitArrays,
                                rowCount: limitArrays2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/Stafftobetrained/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myArrays = parent.$Stafftobetrained.Arrays;
                    myarray = {};
                    for (var i = 0; i < myArrays.length; i++) {
                        if (myArrays[i].id == vueApp.id) {
                            myarray = myArrays[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myarray
                    };
                });
                break;
                //提交
            case '/api/Stafftobetrained/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    var thisArrays = parent.$Stafftobetrained.Arrays;
                    var cz = true;
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].Employeeregister = thisentity.Employeeregister;
                            thisArrays[i].Dateofentry = thisentity.Dateofentry;
                            thisArrays[i].Founder = thisentity.Founder;
                            thisArrays[i].Dateofbirth = thisentity.Dateofbirth;
                            thisArrays[i].Subordinatedepartments = thisentity.Subordinatedepartments;
                            thisArrays[i].Engagedinwork = thisentity.Engagedinwork;
                            thisArrays[i].Positionandposition = thisentity.Positionandposition;
                            thisArrays[i].Phonenumber = thisentity.Phonenumber;
                            thisArrays[i].Gender = thisentity.Gender;
                            thisArrays[i].Dualheadquartersstaff = thisentity.Dualheadquartersstaff;
                            thisArrays[i].GuaranteeCard = thisentity.GuaranteeCard;
                            thisArrays[i].photo = thisentity.photo;
                            thisArrays[i].Whethertojointhetraining = thisentity.Whethertojointhetraining;



                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$Stafftobetrained.Arrays.push({
                            id: thisentity.id,
                            Employeeregister: thisentity.Employeeregister,
                            Dateofentry: thisentity.Dateofentry,
                            Founder: thisentity.Founder,
                            Dateofbirth: thisentity.Dateofbirth,
                            Subordinatedepartments: thisentity.Subordinatedepartments,
                            Engagedinwork: thisentity.Engagedinwork,
                            Positionandposition: thisentity.Positionandposition,
                            Phonenumber: thisentity.Phonenumber,
                            Gender: thisentity.Gender,
                            Dualheadquartersstaff: thisentity.Dualheadquartersstaff,
                            photo: thisentity.photo,
                            Whethertojointhetraining: thisentity.Whethertojointhetraining,



                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            //注意  随机数据初始都是随机姓名，需要自己手动调整
            $Stafftobetrained.Arrays.push(Mock.mock({
                id: Mock.Random.id(), //必须有
                Employeeregister: randomValue('02'), //员工名册
                Dateofentry: Mock.Random.date(), //入职日期
                Founder: randomValue('02'), //创建人
                Dateofbirth: Mock.Random.date(), //出生日期
                Subordinatedepartments: randomValue('14'), //所属部门
                Engagedinwork: randomValue('n52'), //从事工种
                Positionandposition: randomValue('n53'), //职位职务
                Phonenumber: randomValue('n64'), //手机号码
                Gender: randomValue('01'), //性别
                Dualheadquartersstaff: randomValue('50'), //双总部人员
                // photo: randomValue('02'), //相片
                Whethertojointhetraining: randomValue('50'), //是否加入培训计划
                Whethertoupload: randomValue('50'), //是否上传保命条款



                // 'score|70-100': 1,
                score: Mock.Random.string('number', 2),
                name: Mock.Random.cname(),
                remarks: Mock.mock('@county(true)'),
            }));

        }
    }
}

// 年度培训计划管理
var $AnnualTrainingPlanManagement = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            ////删除
            case '/api/AnnualTrainingPlanManagement/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $AnnualTrainingPlanManagement.Arrays.length; i++) {
                        temp.push($AnnualTrainingPlanManagement.Arrays[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $AnnualTrainingPlanManagement.Arrays.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/AnnualTrainingPlanManagement/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($AnnualTrainingPlanManagement.Arrays.length == 0) {
                            $AnnualTrainingPlanManagement.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //查询条件 写自己的查询条件 
                        var Trainingcontents = p.model.Trainingcontents;
                        var Trainingteacher = p.model.Trainingteacher;
                        var TrainingdateStart = p.model.TrainingdateStart;
                        var TrainingdateEnd = p.model.TrainingdateEnd;

                        //分页条件
                        var offset = p.offset;
                        var limit = p.limit;
                        //查询条件 按自己实际的去过滤
                        var limitArrays2 = [];
                        for (var i = 0; i < $AnnualTrainingPlanManagement.Arrays.length; i++) {
                            var AnnualTrainingPlanManagement = $AnnualTrainingPlanManagement.Arrays[i];
                            if (Trainingcontents && AnnualTrainingPlanManagement.Trainingcontents.indexOf(Trainingcontents) == -1)
                                continue;
                            if (Trainingteacher && AnnualTrainingPlanManagement.Trainingteacher.indexOf(Trainingteacher) == -1)
                                continue;
                            if (TrainingdateStart && TrainingdateStart >= AnnualTrainingPlanManagement.Trainingdate)
                                continue;
                            if (TrainingdateEnd && TrainingdateEnd <= AnnualTrainingPlanManagement.Trainingdate)
                                continue;

                            limitArrays2.push(AnnualTrainingPlanManagement);
                        }
                        var limitArrays = [];
                        for (var i = 0; i < limitArrays2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitArrays.push(limitArrays2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitArrays,
                                rowCount: limitArrays2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/AnnualTrainingPlanManagement/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myArrays = parent.$AnnualTrainingPlanManagement.Arrays;
                    myarray = {};
                    for (var i = 0; i < myArrays.length; i++) {
                        if (myArrays[i].id == vueApp.id) {
                            myarray = myArrays[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myarray
                    };
                });
                break;
                //提交
            case '/api/AnnualTrainingPlanManagement/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    var thisArrays = parent.$AnnualTrainingPlanManagement.Arrays;
                    var cz = true;
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].Trainingcontents = thisentity.Trainingcontents;
                            thisArrays[i].Trainingdate = thisentity.Trainingdate;
                            thisArrays[i].Trainingtype = thisentity.Trainingtype;
                            thisArrays[i].Trainingteacher = thisentity.Trainingteacher;
                            thisArrays[i].Nameoftrainingplan = thisentity.Nameoftrainingplan;
                            thisArrays[i].Trainingvenue = thisentity.Trainingvenue;
                            thisArrays[i].Trainingobjectives = thisentity.Trainingobjectives;
                            thisArrays[i].Titleoftitle = thisentity.Titleoftitle;
                            thisArrays[i].Trainingmode = thisentity.Trainingmode;




                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$AnnualTrainingPlanManagement.Arrays.push({
                            id: thisentity.id,
                            Trainingcontents: thisentity.Trainingcontents,
                            Trainingdate: thisentity.Trainingdate,
                            Trainingtype: thisentity.Trainingtype,
                            Trainingteacher: thisentity.Trainingteacher,
                            Nameoftrainingplan: thisentity.Nameoftrainingplan,
                            Trainingvenue: thisentity.Trainingvenue,
                            Trainingobjectives: thisentity.Trainingobjectives,
                            Titleoftitle: thisentity.Titleoftitle,
                            Trainingmode: thisentity.Trainingmode,




                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            //注意  随机数据初始都是随机姓名，需要自己手动调整
            $AnnualTrainingPlanManagement.Arrays.push(Mock.mock({
                id: Mock.Random.id(), //必须有
                Trainingcontents: randomValue('w63'), //培训内容
                Trainingdate: Mock.Random.date(), //培训时间
                Trainingtype: randomValue('w64'), //培训类型
                Trainingteacher: Mock.Random.cname(), //培训老师
                Nameoftrainingplan: randomValue('33'), //培训计划名称
                Trainingvenue: randomValue('11'), //培训地点
                Trainingobjectives: randomValue('w63'), //培训目标
                Titleoftitle: randomValue('19'), //题目名称
                Trainingmode: randomValue('19'), //培训方式




                // 'score|70-100': 1,
                score: Mock.Random.string('number', 2),
                name: Mock.Random.cname(),
                remarks: Mock.mock('@county(true)'),
            }));

        }
    }
}

// 课件管理
var $Coursewaremanagement = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            ////删除
            case '/api/Coursewaremanagement/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $Coursewaremanagement.Arrays.length; i++) {
                        temp.push($Coursewaremanagement.Arrays[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $Coursewaremanagement.Arrays.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/Coursewaremanagement/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($Coursewaremanagement.Arrays.length == 0) {
                            $Coursewaremanagement.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //查询条件 写自己的查询条件 
                        var Topicname = p.model.Topicname;

                        //分页条件
                        var offset = p.offset;
                        var limit = p.limit;
                        //查询条件 按自己实际的去过滤
                        var limitArrays2 = [];
                        for (var i = 0; i < $Coursewaremanagement.Arrays.length; i++) {
                            var Coursewaremanagement = $Coursewaremanagement.Arrays[i];
                            if (Topicname && Coursewaremanagement.Topicname.indexOf(Topicname) == -1)
                                continue;


                            limitArrays2.push(Coursewaremanagement);
                        }
                        var limitArrays = [];
                        for (var i = 0; i < limitArrays2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitArrays.push(limitArrays2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitArrays,
                                rowCount: limitArrays2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/Coursewaremanagement/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myArrays = parent.$Coursewaremanagement.Arrays;
                    myarray = {};
                    for (var i = 0; i < myArrays.length; i++) {
                        if (myArrays[i].id == vueApp.id) {
                            myarray = myArrays[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myarray
                    };
                });
                break;
                //提交
            case '/api/Coursewaremanagement/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    var thisArrays = parent.$Coursewaremanagement.Arrays;
                    var cz = true;
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].Topicname = thisentity.Topicname;
                            thisArrays[i].Trainingdate = thisentity.Trainingdate;
                            thisArrays[i].Qualifiedscore = thisentity.Qualifiedscore;
                            thisArrays[i].Endtime = thisentity.Endtime;
                            thisArrays[i].NumberofExistingQuestions = thisentity.NumberofExistingQuestions;
                            thisArrays[i].Courseware = thisentity.Courseware;
                            thisArrays[i].testquestions = thisentity.testquestions;
                            thisArrays[i].Totalscore = thisentity.Totalscore;
                            thisArrays[i].Qualifiedscore = thisentity.Qualifiedscore;
                            thisArrays[i].Scoreperitem = thisentity.Scoreperitem;
                            thisArrays[i].Titleoftitle = thisentity.Titleoftitle;
                            thisArrays[i].Questiontype = thisentity.Questiontype;
                            thisArrays[i].Answer = thisentity.Answer;
                            thisArrays[i].OptionsList = thisentity.OptionsList;

                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$Coursewaremanagement.Arrays.push({
                            id: thisentity.id,
                            Topicname: thisentity.Topicname,
                            Trainingdate: thisentity.Trainingdate,
                            Qualifiedscore: thisentity.Qualifiedscore,
                            Endtime: thisentity.Endtime,
                            NumberofExistingQuestions: thisentity.NumberofExistingQuestions,
                            Courseware: thisentity.Courseware,
                            testquestions: thisentity.testquestions,
                            Totalscore: thisentity.Totalscore,
                            Scoreperitem: thisentity.Scoreperitem,
                            Qualifiedscore: thisentity.Qualifiedscore,
                            Titleoftitle: thisentity.Titleoftitle,
                            Questiontype: thisentity.Questiontype,
                            Answer: thisentity.Answer,
                            OptionsList: thisentity.OptionsList,



                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            //注意  随机数据初始都是随机姓名，需要自己手动调整
            $Coursewaremanagement.Arrays.push(Mock.mock({
                id: Mock.Random.id(), //必须有
                Topicname: randomValue('21'), //课题名称
                Trainingmode: randomValue('w64'), //培训方式
                Trainingdate: Mock.Random.date(), //开始时间
                Endtime: Mock.Random.date(), //结束时间
                NumberofExistingQuestions: Mock.Random.string('number', 2), //已有考题数量
                Courseware: randomValue('54'), //课件
                testquestions: randomValue('53'), //试题
                Totalscore: Mock.Random.string('number', 2), //总分数
                Qualifiedscore: Mock.Random.string('number', 2), //合格分数
                Scoreperitem: Mock.Random.string('number', 1), //每题分数
                Titleoftitle: randomValue('44'), //题目名称
                Questiontype: randomValue('j12'), //题型
                Answer: randomValue('80'), //答案




                // 'score|70-100': 1,
                score: Mock.Random.string('number', 2),
                name: Mock.Random.cname(),
                remarks: Mock.mock('@county(true)'),
                OptionsList: OptionsList(), //试题选项
            }));

        }
    }
}

function OptionsList() {
    var QuestionManagementOptionsList = [];
    for (var i = 0; i < 4; i++) {
        var OptionsList = {};
        OptionsList.OptionName = getDicValue("80", i);
        OptionsList.OptionComment = Mock.mock('@ctitle');
        OptionsList.IsAnswer = randomValue("50");
        QuestionManagementOptionsList.push(OptionsList);
    }
    return QuestionManagementOptionsList;
}

// 模拟考试
var $HSEMockexam = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            ////删除
            case '/api/HSEMockexam/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $HSEMockexam.Arrays.length; i++) {
                        temp.push($HSEMockexam.Arrays[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $HSEMockexam.Arrays.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/HSEMockexam/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($HSEMockexam.Arrays.length == 0) {
                            $HSEMockexam.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //查询条件 写自己的查询条件 
                        var Particularyear = p.model.Particularyear;

                        //分页条件
                        var offset = p.offset;
                        var limit = p.limit;
                        //查询条件 按自己实际的去过滤
                        var limitArrays2 = [];
                        for (var i = 0; i < $HSEMockexam.Arrays.length; i++) {
                            var HSEMockexam = $HSEMockexam.Arrays[i];
                            if (Particularyear && HSEMockexam.Particularyear.indexOf(Particularyear) == -1)
                                continue;


                            limitArrays2.push(HSEMockexam);
                        }
                        var limitArrays = [];
                        for (var i = 0; i < limitArrays2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitArrays.push(limitArrays2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitArrays,
                                rowCount: limitArrays2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/HSEMockexam/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myArrays = parent.$HSEMockexam.Arrays;
                    myarray = {};
                    for (var i = 0; i < myArrays.length; i++) {
                        if (myArrays[i].id == vueApp.id) {
                            myarray = myArrays[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myarray
                    };
                });
                break;
                //提交
            case '/api/HSEMockexam/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    var thisArrays = parent.$HSEMockexam.Arrays;
                    var cz = true;
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].Nameoftestpaper = thisentity.Nameoftestpaper;
                            thisArrays[i].Examinationmethods = thisentity.Examinationmethods;
                            thisArrays[i].Examinationstarttime = thisentity.Examinationstarttime;
                            thisArrays[i].Endtimeofexamination = thisentity.Endtimeofexamination;
                            thisArrays[i].state = thisentity.state;
                            thisArrays[i].Qualificationscore = thisentity.Qualificationscore;
                            thisArrays[i].Numberofexaminations = thisentity.Numberofexaminations;

                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$HSEMockexam.Arrays.push({
                            id: thisentity.id,
                            Nameoftestpaper: thisentity.Nameoftestpaper,
                            Examinationmethods: thisentity.Examinationmethods,
                            Examinationstarttime: thisentity.Examinationstarttime,
                            Endtimeofexamination: thisentity.Endtimeofexamination,
                            state: thisentity.state,
                            Qualificationscore: thisentity.Qualificationscore,
                            Numberofexaminations: thisentity.Numberofexaminations,






                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            //注意  随机数据初始都是随机姓名，需要自己手动调整
            $HSEMockexam.Arrays.push(Mock.mock({
                id: Mock.Random.id(), //必须有
                Nameoftestpaper: randomValue('n92'), //试卷名称
                Examinationmethods: randomValue('w64'), //考试方式
                Examinationstarttime: Mock.Random.date(), //考试开始时间
                Endtimeofexamination: Mock.Random.date(), //考试结束时间
                state: randomValue('n54'), //状态
                Qualificationscore: 60, //合格分数
                Numberofexaminations: Mock.Random.string('number', 1), //考试次数






                // 'score|70-100': 1,
                score: Mock.Random.string('number', 2),
                name: Mock.Random.cname(),
                remarks: Mock.mock('@county(true)'),
            }));

        }
    }
}

// 在线考试
var $HSEMockexam = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            ////删除
            case '/api/HSEMockexam/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $HSEMockexam.Arrays.length; i++) {
                        temp.push($HSEMockexam.Arrays[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $HSEMockexam.Arrays.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/HSEMockexam/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($HSEMockexam.Arrays.length == 0) {
                            $HSEMockexam.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //查询条件 写自己的查询条件 
                        var Particularyear = p.model.Particularyear;

                        //分页条件
                        var offset = p.offset;
                        var limit = p.limit;
                        //查询条件 按自己实际的去过滤
                        var limitArrays2 = [];
                        for (var i = 0; i < $HSEMockexam.Arrays.length; i++) {
                            var HSEMockexam = $HSEMockexam.Arrays[i];
                            if (Particularyear && HSEMockexam.Particularyear.indexOf(Particularyear) == -1)
                                continue;


                            limitArrays2.push(HSEMockexam);
                        }
                        var limitArrays = [];
                        for (var i = 0; i < limitArrays2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitArrays.push(limitArrays2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitArrays,
                                rowCount: limitArrays2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/HSEMockexam/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myArrays = parent.$HSEMockexam.Arrays;
                    myarray = {};
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].Nameoftestpaper = thisentity.Nameoftestpaper;
                            thisArrays[i].Examinationmethods = thisentity.Examinationmethods;
                            thisArrays[i].Examinationstarttime = thisentity.Examinationstarttime;
                            thisArrays[i].Endtimeofexamination = thisentity.Endtimeofexamination;
                            thisArrays[i].state = thisentity.state;
                            thisArrays[i].Qualificationscore = thisentity.Qualificationscore;
                            thisArrays[i].Numberofexaminations = thisentity.Numberofexaminations;
                            thisArrays[i].time = thisentity.time;
                            thisArrays[i].Answerscore = thisentity.Answerscore;
                            thisArrays[i].Correctquantity = thisentity.Correctquantity;
                            thisArrays[i].Wrongnumber = thisentity.Wrongnumber;
                            thisArrays[i].Titleofexamination = thisentity.Titleofexamination;
                            thisArrays[i].rightkey = thisentity.rightkey;
                            thisArrays[i].Mychoice = thisentity.Mychoice;
                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$HSEMockexam.Arrays.push({
                            id: thisentity.id,
                            Nameoftestpaper: thisentity.Nameoftestpaper,
                            Examinationmethods: thisentity.Examinationmethods,
                            Examinationstarttime: thisentity.Examinationstarttime,
                            Endtimeofexamination: thisentity.Endtimeofexamination,
                            state: thisentity.state,
                            Qualificationscore: thisentity.Qualificationscore,
                            Numberofexaminations: thisentity.Numberofexaminations,
                            time: thisentity.time,
                            Answerscore: thisentity.Answerscore,
                            Correctquantity: thisentity.Correctquantity,
                            Wrongnumber: thisentity.Wrongnumber,
                            Titleofexamination: thisentity.Titleofexamination,
                            rightkey: thisentity.rightkey,
                            Mychoice: thisentity.Mychoice,





                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //提交
            case '/api/HSEMockexam/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    var thisArrays = parent.$HSEMockexam.Arrays;
                    var cz = true;
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].Nameoftestpaper = thisentity.Nameoftestpaper;
                            thisArrays[i].Examinationmethods = thisentity.Examinationmethods;
                            thisArrays[i].Examinationstarttime = thisentity.Examinationstarttime;
                            thisArrays[i].Endtimeofexamination = thisentity.Endtimeofexamination;
                            thisArrays[i].state = thisentity.state;
                            thisArrays[i].Qualificationscore = thisentity.Qualificationscore;
                            thisArrays[i].Numberofexaminations = thisentity.Numberofexaminations;
                            thisArrays[i].time = thisentity.time;
                            thisArrays[i].Answerscore = thisentity.Answerscore;
                            thisArrays[i].Correctquantity = thisentity.Correctquantity;
                            thisArrays[i].Wrongnumber = thisentity.Wrongnumber;
                            thisArrays[i].Titleofexamination = thisentity.Titleofexamination;
                            thisArrays[i].rightkey = thisentity.rightkey;
                            thisArrays[i].Mychoice = thisentity.Mychoice;

                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$HSEMockexam.Arrays.push({
                            id: thisentity.id,
                            Nameoftestpaper: thisentity.Nameoftestpaper,
                            Examinationmethods: thisentity.Examinationmethods,
                            Examinationstarttime: thisentity.Examinationstarttime,
                            Endtimeofexamination: thisentity.Endtimeofexamination,
                            state: thisentity.state,
                            Qualificationscore: thisentity.Qualificationscore,
                            Numberofexaminations: thisentity.Numberofexaminations,
                            time: thisentity.time,
                            Answerscore: thisentity.Answerscore,
                            Correctquantity: thisentity.Correctquantity,
                            Wrongnumber: thisentity.Wrongnumber,
                            Titleofexamination: thisentity.Titleofexamination,
                            rightkey: thisentity.rightkey,
                            Mychoice: thisentity.Mychoice,

                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            //注意  随机数据初始都是随机姓名，需要自己手动调整
            $HSEMockexam.Arrays.push(Mock.mock({
                id: Mock.Random.id(), //必须有
                Nameoftestpaper: randomValue('w66'), //试卷名称
                Examinationmethods: randomValue('w64'), //考试方式
                Examinationstarttime: Mock.Random.date(), //考试开始时间
                Endtimeofexamination: Mock.Random.date(), //考试结束时间
                state: randomValue('n54'), //状态
                Qualificationscore: 60, //合格分数
                Numberofexaminations: Mock.Random.string('number', 1), //考试次数                
                NumberofexamScore: Mock.mock({
                    "number|50-99": 99
                }).number, //考试分数
                time: Mock.Random.date(), //时间
                Answerscore: Mock.Random.string('number', 2), //答题分数
                Correctquantity: Mock.mock({
                    "number|15-20": 20
                }).number, //正确数量
                Wrongnumber: Mock.Random.string('number', 1), //错误数量
                Titleofexamination: randomValue('35'), //考题名称
                rightkey: randomValue('w65'), //正确答案
                Mychoice: randomValue('w65'), //我的选择






                // 'score|70-100': 1,
                score: Mock.Random.string('number', 2),
                name: Mock.Random.cname(),
                remarks: Mock.mock('@county(true)'),
            }));

        }
    }
}

// 学分完成情况统计
var $Creditcompletionstatistics = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            ////删除
            case '/api/Creditcompletionstatistics/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $Creditcompletionstatistics.Arrays.length; i++) {
                        temp.push($Creditcompletionstatistics.Arrays[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $Creditcompletionstatistics.Arrays.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/Creditcompletionstatistics/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($Creditcompletionstatistics.Arrays.length == 0) {
                            $Creditcompletionstatistics.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //查询条件 写自己的查询条件 
                        var Particularyear = p.model.Particularyear;

                        //分页条件
                        var offset = p.offset;
                        var limit = p.limit;
                        //查询条件 按自己实际的去过滤
                        var limitArrays2 = [];
                        for (var i = 0; i < $Creditcompletionstatistics.Arrays.length; i++) {
                            var Creditcompletionstatistics = $Creditcompletionstatistics.Arrays[i];
                            if (Particularyear && Creditcompletionstatistics.Particularyear.indexOf(Particularyear) == -1)
                                continue;


                            limitArrays2.push(Creditcompletionstatistics);
                        }
                        var limitArrays = [];
                        for (var i = 0; i < limitArrays2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitArrays.push(limitArrays2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitArrays,
                                rowCount: limitArrays2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/Creditcompletionstatistics/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myArrays = parent.$Creditcompletionstatistics.Arrays;
                    myarray = {};
                    for (var i = 0; i < myArrays.length; i++) {
                        if (myArrays[i].id == vueApp.id) {
                            myarray = myArrays[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myarray
                    };
                });
                break;
                //提交
            case '/api/Creditcompletionstatistics/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    var thisArrays = parent.$Creditcompletionstatistics.Arrays;
                    var cz = true;
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].Particularyear = thisentity.Particularyear;
                            thisArrays[i].Completionratio = thisentity.Completionratio;
                            thisArrays[i].Completionnumber = thisentity.Completionnumber;
                            thisArrays[i].Percentage = thisentity.Percentage;
                            thisArrays[i].Piechart = thisentity.Piechart;






                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$Creditcompletionstatistics.Arrays.push({
                            id: thisentity.id,
                            Particularyear: thisentity.Particularyear,
                            Completionratio: thisentity.Completionratio,
                            Completionnumber: thisentity.Completionnumber,
                            Percentage: thisentity.Percentage,
                            Piechart: thisentity.Piechart,






                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            //注意  随机数据初始都是随机姓名，需要自己手动调整
            $Creditcompletionstatistics.Arrays.push(Mock.mock({
                id: Mock.Random.id(), //必须有
                Particularyear: randomValue('w1'), //年份
                Completionratio: Mock.Random.string('number', 2) + "%", //完成比例
                Completionnumber: Mock.Random.string('number', 2), //完成人数
                Percentage: Mock.Random.string('number', 2) + "%", //百分比
                Piechart: randomValue('33'), //饼状图






                // 'score|70-100': 1,
                score: Mock.Random.string('number', 2),
                name: Mock.Random.cname(),
                remarks: Mock.mock('@county(true)'),
            }));

        }
    }
}

//办公安全分委会积分考核
var $ScoreAssessmentOfficeSecurity = {
    DealUrl: function (vueApp, url, type, param) {
        var my = vueApp;
        switch (url) {
            //删除
            case '/api/ScoreAssessmentOfficeSecurity/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $ScoreAssessmentOfficeSecurity.EquipmenFacilities.length; i++) {
                        temp.push($ScoreAssessmentOfficeSecurity.EquipmenFacilities[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $ScoreAssessmentOfficeSecurity.EquipmenFacilities.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/ScoreAssessmentOfficeSecurity/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($ScoreAssessmentOfficeSecurity.EquipmenFacilities.length == 0) {
                            $ScoreAssessmentOfficeSecurity.InitArray();
                        }
                        var p = JSON.parse(options.body);

                        var name = p.model.name;
                        //分页
                        var offset = p.offset;
                        var limit = p.limit;
                        var limitUsers2 = [];
                        for (var i = 0; i < $ScoreAssessmentOfficeSecurity.EquipmenFacilities.length; i++) {
                            var user = $ScoreAssessmentOfficeSecurity.EquipmenFacilities[i];

                            if (name && user.name.indexOf(name) == -1)
                                continue;
                            limitUsers2.push(user);
                        }

                        var limitUsers = [];
                        for (var i = 0; i < limitUsers2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitUsers.push(limitUsers2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitUsers,
                                rowCount: limitUsers2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/ScoreAssessmentOfficeSecurity/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myUsers = parent.$ScoreAssessmentOfficeSecurity.EquipmenFacilities;
                    var myuser;
                    for (var i = 0; i < myUsers.length; i++) {
                        var testingcomentList = myUsers[i].TestingcomentList;
                        for (var j = 0; j < testingcomentList.length; j++) {
                            var testingcomentItem = testingcomentList[j]
                            if (testingcomentItem.id == vueApp.id) {
                                myuser = testingcomentItem;
                                break;
                            }
                        }
                        if (myuser)
                            break
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myuser
                    };
                });
                break;
            case '/api/ScoreAssessmentOfficeSecurity/getAdd':
                Mock.mock(host + url + '?' + param, type, function (options) {

                    var myUsers = parent.$ScoreAssessmentOfficeSecurity.EquipmenFacilities;
                    myuser = {};
                    for (var i = 0; i < myUsers.length; i++) {
                        if (myUsers[i].id == vueApp.id) {
                            myuser = myUsers[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myuser
                    };
                });
                break;



                ////提交
            case '/api/ScoreAssessmentOfficeSecurity/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisuser = JSON.parse(options.body);
                    var thisUsers = parent.$ScoreAssessmentOfficeSecurity.EquipmenFacilities;
                    var cz = true;
                    for (var i = 0; i < thisUsers.length; i++) {
                        var obj = thisUsers[i].TestingcomentList;
                        for (var j = 0; j < obj.length; j++) {
                            var testingcomentItem = obj[j];
                            if (thisuser.id == testingcomentItem.id) {
                                testingcomentItem.month = thisuser.month;
                                testingcomentItem.year = thisuser.year;
                                testingcomentItem.itemType = thisuser.itemType;
                                testingcomentItem.scope = thisuser.scope;
                                cz = false;
                                break;
                            }
                        }
                        if (cz == false) {
                            break;
                        }
                    }
                    if (cz) {
                        for (var i = 0; i < thisUsers.length; i++) {
                            if (thisuser.id == thisUsers[i].id) {
                                var list = {};
                                list.month = thisuser.month;
                                list.year = thisuser.year;
                                list.itemType = thisuser.itemType;
                                list.scope = thisuser.scope;
                                list.id = Mock.Random.id();
                                list.Pid = thisuser.id;
                                thisUsers[i].TestingcomentList.push(list);
                            }
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                ////提交
            case '/api/ScoreAssessmentOfficeSecurity/SaveUser':
                Mock.mock(host + url, type, function (options) {
                    var thisuser = JSON.parse(options.body);
                    var thisUsers = parent.$ScoreAssessmentOfficeSecurity.EquipmenFacilities;
                    var cz = true;
                    for (var i = 0; i < thisUsers.length; i++) {
                        if (thisUsers[i].id == thisuser.id) {
                            thisUsers[i].name = thisuser.name;
                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        parent.$ScoreAssessmentOfficeSecurity.EquipmenFacilities.push({
                            id: thisuser.id,
                            name: thisuser.name,
                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    EquipmenFacilities: [],
    InitArray: function () {
        for (var i = 0; i < 30; i++) {
            var Id = Mock.Random.id();
            $ScoreAssessmentOfficeSecurity.EquipmenFacilities.push(Mock.mock({
                id: Id,
                name: Mock.Random.cname(),
                allScore: 9,
                TestingcomentList: [{
                    time: Mock.Random.date(),
                    // year: randomValue('w1'),
                    itemType: randomValue('n77'),
                    scope: 4,
                    id: Mock.Random.id(),
                    Pid: Id
                }, {
                    time: Mock.Random.date(),
                    // year: randomValue('w1'),
                    itemType: randomValue('n77'),
                    scope: 5,
                    id: Mock.Random.id(),
                    Pid: Id
                }],
            }));
        }
    }
}

// 产品MSDS数据库
var $MSDSdatabase = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            ////删除
            case '/api/MSDSdatabase/DeleteMuti':
                Mock.mock(host + url, type, function (options) {
                    var delIDs = options.body;
                    var temp = [];
                    for (var i = 0; i < $MSDSdatabase.Arrays.length; i++) {
                        temp.push($MSDSdatabase.Arrays[i]);
                    }
                    for (var i = 0; i < temp.length; i++) {
                        if (delIDs.includes(temp[i].id)) {
                            $MSDSdatabase.Arrays.splice(temp[i], 1);
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
                //获取List数据
            case '/api/MSDSdatabase/GetList':
                Mock.mock(host + url, type,
                    function (options) {
                        if ($MSDSdatabase.Arrays.length == 0) {
                            $MSDSdatabase.InitArray();
                        }
                        var p = JSON.parse(options.body);
                        //查询条件 写自己的查询条件 
                        var ChemicalChineseName = p.model.ChemicalChineseName;
                        var ChemicalEnglishName = p.model.ChemicalEnglishName;
                        var ManufacturerName = p.model.ManufacturerName;
                        var DateofadditionBegin = p.model.DateofadditionBegin;
                        var DateofadditionEnd = p.model.DateofadditionEnd;
                        //分页条件
                        var offset = p.offset;
                        var limit = p.limit;
                        //查询条件 按自己实际的去过滤
                        var limitArrays2 = [];
                        for (var i = 0; i < $MSDSdatabase.Arrays.length; i++) {
                            var MSDSdatabase = $MSDSdatabase.Arrays[i];
                            if (ChemicalChineseName && MSDSdatabase.ChemicalChineseName.indexOf(ChemicalChineseName) == -1)
                                continue;
                            if (ChemicalEnglishName && MSDSdatabase.ChemicalEnglishName.indexOf(ChemicalEnglishName) == -1)
                                continue;
                            if (ManufacturerName && MSDSdatabase.ManufacturerName.indexOf(ManufacturerName) == -1)
                                continue;
                            if (DateofadditionBegin && DateofadditionBegin >= MSDSdatabase.Dateofaddition)
                                continue;
                            if (DateofadditionEnd && DateofadditionEnd <= MSDSdatabase.Dateofaddition)
                                continue;
                            limitArrays2.push(MSDSdatabase);
                        }
                        var limitArrays = [];
                        for (var i = 0; i < limitArrays2.length; i++) {
                            if (i < offset + limit && i >= offset) {
                                limitArrays.push(limitArrays2[i]);
                            }
                        }
                        return {
                            result: "Success",
                            message: null,
                            data: {
                                pageData: limitArrays,
                                rowCount: limitArrays2.length
                            }
                        };
                    });
                break;
                //获取Input数据
            case '/api/MSDSdatabase/get':
                Mock.mock(host + url + '?' + param, type, function (options) {
                    var myArrays = parent.$MSDSdatabase.Arrays;
                    myarray = {};
                    for (var i = 0; i < myArrays.length; i++) {
                        if (myArrays[i].id == vueApp.id) {
                            myarray = myArrays[i];
                            break;
                        }
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: myarray
                    };
                });
                break;
                //提交
            case '/api/MSDSdatabase/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    var thisArrays = parent.$MSDSdatabase.Arrays;
                    var cz = true;
                    for (var i = 0; i < thisArrays.length; i++) {
                        //按自己实际的去修改内容
                        if (thisArrays[i].id == thisentity.id) {
                            thisArrays[i].ChemicalChineseName = thisentity.ChemicalChineseName;
                            thisArrays[i].ChemicalEnglishName = thisentity.ChemicalEnglishName;
                            thisArrays[i].ChemicalName = thisentity.ChemicalName;
                            thisArrays[i].EnglishName = thisentity.EnglishName;
                            thisArrays[i].CASNo = thisentity.CASNo;
                            thisArrays[i].SpecificationCode = thisentity.SpecificationCode;
                            thisArrays[i].Address = thisentity.Address;
                            thisArrays[i].EffectiveDate = thisentity.EffectiveDate;
                            thisArrays[i].Dateofaddition = thisentity.Dateofaddition;
                            thisArrays[i].Addpeople = thisentity.Addpeople;
                            thisArrays[i].CompositionInformation = thisentity.CompositionInformation;
                            thisArrays[i].RiskOverview = thisentity.RiskOverview;
                            thisArrays[i].First_aid = thisentity.First_aid;
                            thisArrays[i].Fire_fightingMeasures = thisentity.Fire_fightingMeasures;
                            thisArrays[i].LeakageEmergencyTreatment = thisentity.LeakageEmergencyTreatment;
                            thisArrays[i].HandlinStorage = thisentity.HandlinStorage;
                            thisArrays[i].ContactControlpersonalProtection = thisentity.ContactControlpersonalProtection;
                            thisArrays[i].ChemicalProperties = thisentity.ChemicalProperties;
                            thisArrays[i].StabilityAndReactivity = thisentity.StabilityAndReactivity;
                            thisArrays[i].ToxicologicalInformation = thisentity.ToxicologicalInformation;
                            thisArrays[i].EcologicalInformation = thisentity.EcologicalInformation;
                            thisArrays[i].Disposal = thisentity.Disposal;
                            thisArrays[i].TransportInformation = thisentity.TransportInformation;
                            thisArrays[i].RegulatoryInformation = thisentity.RegulatoryInformation;
                            thisArrays[i].OtherInformation = thisentity.OtherInformation;
                            cz = false;
                            break;
                        }
                    }
                    if (cz) {
                        //Input 页面需要 去操作List页面的数组 parent
                        //按自己实际的去添加内容
                        parent.$MSDSdatabase.Arrays.push({
                            id: thisentity.id,
                            ChemicalChineseName: thisentity.ChemicalChineseName,
                            ChemicalEnglishName: thisentity.ChemicalEnglishName,
                            ChemicalName: thisentity.ChemicalName,
                            EnglishName: thisentity.EnglishName,
                            CASNo: thisentity.CASNo,
                            SpecificationCode: thisentity.SpecificationCode,
                            Address: thisentity.Address,
                            EffectiveDate: thisentity.EffectiveDate,
                            Dateofaddition: Mock.Random.date(),
                            Addpeople: randomValue('16'), //添加人
                            CompositionInformation: thisentity.CompositionInformation,
                            RiskOverview: thisentity.RiskOverview,
                            First_aid: thisentity.First_aid,
                            Fire_fightingMeasures: thisentity.Fire_fightingMeasures,
                            LeakageEmergencyTreatment: thisentity.LeakageEmergencyTreatment,
                            HandlinStorage: thisentity.HandlinStorage,
                            ContactControlpersonalProtection: thisentity.ContactControlpersonalProtection,
                            ChemicalProperties: thisentity.ChemicalProperties,
                            StabilityAndReactivity: thisentity.StabilityAndReactivity,
                            ToxicologicalInformation: thisentity.ToxicologicalInformation,
                            EcologicalInformation: thisentity.EcologicalInformation,
                            Disposal: thisentity.Disposal,
                            TransportInformation: thisentity.TransportInformation,
                            RegulatoryInformation: thisentity.RegulatoryInformation,
                            OtherInformation: thisentity.OtherInformation,
                        });
                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        for (var i = 0; i < 20; i++) {
            //注意  随机数据初始都是随机姓名，需要自己手动调整
            $MSDSdatabase.Arrays.push(Mock.mock({
                id: Mock.Random.id(), //必须有
                ChemicalChineseName: randomValue('z300'), //化学品英文名称
                ChemicalEnglishName: Mock.mock('@string(7, 10)'), //国家
                ChemicalName: randomValue('z300'), //化学品英文名称
                EnglishName: Mock.mock('@string(7, 10)'), //国家
                CASNo: Mock.Random.id(), //CASNo
                SpecificationCode: Mock.Random.id(), //技术说明书编码
                ManufacturerName: randomValue('08'), //生产企业名称
                Address: Mock.mock('@county(true)'), //",地址
                EffectiveDate: Mock.Random.date(), //生效日期
                Dateofaddition: Mock.Random.date(), //添加日期
                Addpeople: randomValue('16'), //添加人
                CompositionInformation: Mock.mock('@cparagraph(1, 6)'), //成分/组成信息
                RiskOverview: Mock.mock('@cparagraph(1, 6)'), //危险性概述
                First_aid: Mock.mock('@cparagraph(1, 6)'), //急救措施
                Fire_fightingMeasures: Mock.mock('@cparagraph(1, 6)'), //消防措施
                LeakageEmergencyTreatment: Mock.mock('@cparagraph(1, 6)'), //泄露应急处理
                HandlinStorage: Mock.mock('@cparagraph(1, 6)'), //操作处置与存储
                ContactControlpersonalProtection: Mock.mock('@cparagraph(1, 6)'), //接触控制/个体防护
                ChemicalProperties: Mock.mock('@cparagraph(1, 6)'), //理化特性
                StabilityAndReactivity: Mock.mock('@cparagraph(1, 6)'), //稳定性与反应活性
                ToxicologicalInformation: Mock.mock('@cparagraph(1, 6)'), //毒理学资料
                EcologicalInformation: Mock.mock('@cparagraph(1, 6)'), //生态学资料
                Disposal: Mock.mock('@cparagraph(1, 6)'), //废弃处置
                TransportInformation: Mock.mock('@cparagraph(1, 6)'), //运输信息
                RegulatoryInformation: Mock.mock('@cparagraph(1, 6)'), //法规信息
                OtherInformation: Mock.mock('@cparagraph(1, 6)'), //其他信息
            }));
        }
    }
}




//HSE管理目标
var $HSEManagementgoalEdit = {
    DealUrl: function (vueApp, url, type, param) {
        switch (url) {
            //获取Input数据
            case '/api/HSEManagementgoalEdit/get':
                Mock.mock(host + url + '?' + param, type, function (options) {

                    var myarray = {
                        id: '123456', //必须有
                        Enterpriseid: Mock.Random.id(),
                        ManagementgoalComent: 'HSE目标：零事故、零污染、零伤害' +
                            '使命：承担社会责任，成为化工行业安全管理的典范。' +
                            '愿景：杜绝一切安全事故，构建安全圣奥，成为社会、用户、员工信赖的化工企业。' +
                            '价值观：以人为本，安全第一。' +
                            '原则：' +
                            '所有的伤害都是可以预防的；' +
                            '管理层对安全负有直接责任；' +
                            '所有安全操作隐患都是可以控制的；' +
                            '安全是被雇佣的条件；' +
                            '员工必须接受严格的安全培训；' +
                            '管理层必须参与安全审核；' +
                            '发现安全隐患必须及时消除；' +
                            '工作外的安全和工作内的安全同样重要；' +
                            '良好的安全文化带来良好的业务；' +
                            ' 员工是安全工作的关键。'
                    };

                    return {
                        result: "Success",
                        message: null,
                        data: myarray
                    };
                });
                break;
                //提交
            case '/api/HSEManagementgoalEdit/Save':
                Mock.mock(host + url, type, function (options) {
                    var thisentity = JSON.parse(options.body);
                    console.log(thisentity);
                    var thisArrays = {
                        id: '123456', //必须有
                        Enterpriseid: Mock.Random.id(),
                        ManagementgoalComent: 'HSE目标：零事故、零污染、零伤害' +
                            '使命：承担社会责任，成为化工行业安全管理的典范。' +
                            '愿景：杜绝一切安全事故，构建安全圣奥，成为社会、用户、员工信赖的化工企业。' +
                            '价值观：以人为本，安全第一。' +
                            '原则：' +
                            '所有的伤害都是可以预防的；' +
                            '管理层对安全负有直接责任；' +
                            '所有安全操作隐患都是可以控制的；' +
                            '安全是被雇佣的条件；' +
                            '员工必须接受严格的安全培训；' +
                            '管理层必须参与安全审核；' +
                            '发现安全隐患必须及时消除；' +
                            '工作外的安全和工作内的安全同样重要；' +
                            '良好的安全文化带来良好的业务；' +
                            ' 员工是安全工作的关键。'
                    };


                    //按自己实际的去修改内容
                    if (thisArrays.id == thisentity.id) {
                        thisArrays.Employeename = Mock.Random.id();
                        thisArrays.ManagementgoalComent = thisentity.ManagementgoalComent;

                    }
                    return {
                        result: "Success",
                        message: null,
                        data: null
                    };
                });
                break;
        }
    },
    Arrays: [],
    InitArray: function () {
        $HSEManagementgoalEdit.Arrays.push(Mock.mock({
            id: '123456', //必须有
            Enterpriseid: Mock.Random.id(),
            ManagementgoalComent: 'HSE目标：零事故、零污染、零伤害' +
                '使命：承担社会责任，成为化工行业安全管理的典范。' +
                '愿景：杜绝一切安全事故，构建安全圣奥，成为社会、用户、员工信赖的化工企业。' +
                '价值观：以人为本，安全第一。' +
                '原则：' +
                '所有的伤害都是可以预防的；' +
                '管理层对安全负有直接责任；' +
                '所有安全操作隐患都是可以控制的；' +
                '安全是被雇佣的条件；' +
                '员工必须接受严格的安全培训；' +
                '管理层必须参与安全审核；' +
                '发现安全隐患必须及时消除；' +
                '工作外的安全和工作内的安全同样重要；' +
                '良好的安全文化带来良好的业务；' +
                ' 员工是安全工作的关键。'
        }));
    }
}